Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

SOLVED

Typology to check sender name

michellelowsl
Level 3
Level 3

Hi all,

How do I check if the email is using a default sender name (content block) in the typology?

I have tried checking if strSender == 'ABC' and change the Phase to After the end of the analysis but it doesnt seem to work.

 

Any help is appreciated 

 

1 Accepted Solution
shelly-goel
Correct answer by
Community Advisor
Community Advisor

@michelle_lowThe entire string may or may not match as is because of the quote inside the quote, class applied could be different or character escaping. I had earlier tried below code and it was working. Match operation would be much more flexible and would also cater to scenario if 'DefaultSenderName' is typed in the Sender Name field.

if (senderName.match(/DefaultSenderName/) || senderName.match(/ABC/)) {logError("Error in" + sg.inFromName());return false;}

View solution in original post

14 Replies
shelly-goel
Community Advisor
Community Advisor

@michellelowsl  I would suggest to do that filtering in the 'Target' section of the delivery itself using General > Profile (attributes). Same can be achieved in the Query activity if using a workflow.

 

shelly-goel_0-1606185586565.png

 

michellelowsl
Level 3
Level 3
Hi Shelly, Thanks for your response but I wanted to check the sender name not the recipient name.
shelly-goel
Community Advisor
Community Advisor
Okay I overlooked your question and interpreted it for recipient's name. I would have suggested to create a control type topology rule similar to 'Check Subject' rule (var strSender = emailContent.senderName.source;strSender.startsWith("abc");) but unfortunately there's no provision to edit existing control rule or add code logic to a new control rule. You might want to give it a try checking with Adobe support if they can help with creating a new control type topology rule.
anasso83525035
Level 3
Level 3

Hello Michelle, to complete Shelly's solution, you can duplicate the Check Subject typology rule, change its ID and export it in a Package. You will then be able to edit the code in notepad++ and apply the control code to the sender name as explained above. Once it's done upload the package back to ACS.

michellelowsl
Level 3
Level 3
Thanks @shelly-goel and @anasso83525035. I was able to implement the same suggestion 🙂 Thanks so much for your help
michellelowsl
Level 3
Level 3
Hi @shelly-goel and @anasso83525035, would you be able to help on this if the sender name is in content block ? I tried to change the Phase to At the end of analysis but it didn't work. Do you know what's the query for a default sender name content block?
Sukrity_Wadhwa
Employee
Employee

Hi @michellelowsl,

Were you able to resolve this query or do you need more help? Do let us know.

Thanks!

michellelowsl
Level 3
Level 3
Hi Sukrity, I have updated my question. can you and your team help?
shelly-goel
Community Advisor
Community Advisor

@michellelowsl  The content/text inside the content block is not available for validation during delivery preparation (typology rule), however if something is added before and after the content block, that could be validated. "emailContent.senderName.source" would be something like below, so you can check if additional "ABC" appears at the start or generate a warning if sender name has "DefaultSenderName" so to manually validate the branding information provided.

emailContent.senderName.source=ABC<span class="nl-dce-fragment nl-dce-done" data-nl-name="DefaultSenderName" contenteditable="false">Default sender name</span>

You may handle the validation in the content block itself and provide an appropriate default value.

 

michelle_low
Level 1
Level 1
Thanks again @shelly-goel. Will it work with just emailContent.senderName.source=<span class="nl-dce-fragment nl-dce-done" data-nl-name="DefaultSenderName" contenteditable="false">Default sender name</span> ?
shelly-goel
Community Advisor
Community Advisor
@michelle_low Not sure if I understand your question, please elaborate about what will work? The string that I provided is what is coming in 'emailContent.senderName.source' during delivery preparation in typology rule compilation. So you can add a condition to check if 'emailContent.senderName.source' contains 'ABC' or 'DefaultSenderName' and generate a warning/ error. User would then maually check if "DefaultSenderName" is correctly configured or not.
michellelowsl
Level 3
Level 3
Hi @shelly-goel, I tried if (emailContent.senderName.source== '<span class="nl-dce-fragment nl-dce-done" data-nl-name="DefaultSenderName" contenteditable="false">Default sender name</span>'){ return false} . It did not give any error when I used the DefaultSenderName content block.
shelly-goel
Correct answer by
Community Advisor
Community Advisor

@michelle_lowThe entire string may or may not match as is because of the quote inside the quote, class applied could be different or character escaping. I had earlier tried below code and it was working. Match operation would be much more flexible and would also cater to scenario if 'DefaultSenderName' is typed in the Sender Name field.

if (senderName.match(/DefaultSenderName/) || senderName.match(/ABC/)) {logError("Error in" + sg.inFromName());return false;}

View solution in original post