Skip to main content
Level 4
Nov 8, 2021 1:54 PM UTC
Solved

Typology rule to check the personalization block present in the email

Scenario: Create a typology rule which will check a personalization block is present in the email delivery and will stop the delivery if the personalization block is missing. 

 

All I could figure out as of now is : I have to create a control typology and in the html source need to check the personalization block- but the major issue is I do not have the syntax of fetching {nms:includeView} from delivery.content.html.source . 

 

1. Where to check the logInfo defined in a typology rule?

2. How to know the syntax if we have to create a new different typology in future? Any references?

3. Please let me know if there is any other way to achieve this.

 

Thank you so much in advance for any help and answer.

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
david--garcia
david--garciaAccepted solution
Level 10
Nov 11, 2021 2:39 AM UTC

Create a control typology rule and add it to your desired typology and assign that to your template, use the code below to check for the personalization internalname

 

 

var x = "dummy_personalization"; //internalname of personalization block
var y = delivery.content.html.source;
var z = y.search(x);

if (z !== -1) { //if not found it returns -1
    logInfo("Found personalization block: " + x);
    return true
} else {
    logWarning("Missing personalization block: " + x);
    return false
}

 

 

 

https://www.linkedin.com/in/david-garcia-uk/ | https://martech.network

3 replies

Jyoti_Yadav
Level 8
Nov 10, 2021 7:49 AM UTC

Hi @poonam_dogra ,

 

We always use one of the personalisation block in our delivery, i.e Mirror Page.

And there is a typology rule which looks whether Mirror Page is included in Delivery or not. You can use this typology rule in your typology and validate whether it has a Personalisation Block included or not.

 

Typology Rule: Social network sharing link validation(viral)

 

Thanks,

Jyoti

Translate
david--garcia
david--garciaAccepted solution
Level 10
Nov 11, 2021 2:39 AM UTC

Create a control typology rule and add it to your desired typology and assign that to your template, use the code below to check for the personalization internalname

 

 

var x = "dummy_personalization"; //internalname of personalization block
var y = delivery.content.html.source;
var z = y.search(x);

if (z !== -1) { //if not found it returns -1
    logInfo("Found personalization block: " + x);
    return true
} else {
    logWarning("Missing personalization block: " + x);
    return false
}

 

 

 

Translate
https://www.linkedin.com/in/david-garcia-uk/ | https://martech.network
Level 4
Nov 11, 2021 5:15 PM UTC

Thank you so much @david--garcia for sharing the demo, it worked perfectly fine....

Regards,

Poonam

Translate