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
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

Typology rule to check the personalization block present in the email

PoonamBhardwaj
Level 2
Level 2

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.

 

1 Accepted Solution
David__Garcia
Correct answer by
Level 9
Level 9

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

David__Garcia_2-1636598579256.png

 

 

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
}

David__Garcia_1-1636598357603.png

 

 

 

View solution in original post

3 Replies
Jyoti_Yadav
Community Advisor
Community Advisor

Hi @PoonamBhardwaj ,

 

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

David__Garcia
Correct answer by
Level 9
Level 9

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

David__Garcia_2-1636598579256.png

 

 

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
}

David__Garcia_1-1636598357603.png

 

 

 

View solution in original post

PoonamBhardwaj
Level 2
Level 2

Thank you so much @David__Garcia for sharing the demo, it worked perfectly fine....

Regards,

Poonam