Expand my Community achievements bar.

SOLVED

Typology to check sender name

Avatar

Level 4

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

Avatar

Correct answer by
Employee 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

Avatar

Employee 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

 

Avatar

Level 4
Hi Shelly, Thanks for your response but I wanted to check the sender name not the recipient name.

Avatar

Employee 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.

Avatar

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.

Avatar

Level 4
Thanks @shelly-goel and @anasso83525035. I was able to implement the same suggestion Thanks so much for your help

Avatar

Level 4
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?

Avatar

Administrator

Hi @michellelowsl,

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

Thanks!



Sukrity Wadhwa

Avatar

Level 4
Hi Sukrity, I have updated my question. can you and your team help?

Avatar

Employee 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.

 

Avatar

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> ?

Avatar

Employee 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.

Avatar

Level 4
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.

Avatar

Correct answer by
Employee 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;}