Expand my Community achievements bar.

SOLVED

Dynamic content in email - Personalize the email

Avatar

Level 6

Hi everyone,

 

My schema has a column name called features with values feature1, feature2, feature3 and one recipient can have multiple features

 

For ex:

recipient 1  feature 1

recipient1  feature 2

recipient 1 feature 3

 

in the HTML, i have added the if conditions but before my email activity there is a deduplication activity. So, not sure if it filters the recipient1 and keeps only one record. 

 

Also, how can I achieve the dynamic content in the email. 

 

For ex:

recipient 2 feature 1

recipient 2  feature 3

recipient3 feature 1

recipient3 feature 3

 

As per the above example, recipient2 purchased two features now I want to show only feature 2 in the email and same for recipient 3

 

if condition fails if the first condition itself satisfies , it will not check for the rest of the conditions in the html. Please suggest

 

Thank you in advance. 

 

 

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hello @rvnth,

can you provide more information?

This is very broad question and I have no idea what you want to achieve.

Is that one column with features that are coma separated? or is it table linked to recipient? or what is the features column?

How do you know the order of the features? it will be always 3? where 1,2,3 and if i have ,2,3 i know that i display feature 1?

You can use in delivery split function

var featuresArray = features.split(",");

if (featuresArray && featuresArray.lenght== 3 && featuresArray[0]==""){

}elseif (featuresArray && featuresArray.lenght== 3 && featuresArray[1]==""){

}elseif (featuresArray && featuresArray.lenght== 3 && featuresArray[2]==""){

}






Marcel Szimonisz

View solution in original post

5 Replies

Avatar

Correct answer by
Community Advisor

Hello @rvnth,

can you provide more information?

This is very broad question and I have no idea what you want to achieve.

Is that one column with features that are coma separated? or is it table linked to recipient? or what is the features column?

How do you know the order of the features? it will be always 3? where 1,2,3 and if i have ,2,3 i know that i display feature 1?

You can use in delivery split function

var featuresArray = features.split(",");

if (featuresArray && featuresArray.lenght== 3 && featuresArray[0]==""){

}elseif (featuresArray && featuresArray.lenght== 3 && featuresArray[1]==""){

}elseif (featuresArray && featuresArray.lenght== 3 && featuresArray[2]==""){

}






Marcel Szimonisz

Avatar

Level 6

Hi @Marcel_Szimonisz , 

 

Thank you for your reply. 

 

yes, the features table is linked with recipient table  but it is not comma separated 

Every time a recipient purchased a new feature , new entry will be created with new feature. For ex:

recipient 1 feature 2

recipient 1 feature 1

recipient 1 feature 3

recipient 2 feature 3

 

It will be 3 features that we are targeting , but a recipient can purchase any feature.

 

If recipient1 purchases feature 3 first time, he should see feature 2 & feature 1

if the recipient purchases feature 1 second time he should see only feature 2. since he already purchased feature 3

if the recipient1 has all the features, he should not be qualified for this workflow. Is there a way that I can exclude the recipients based on the feature purchased. 

For ex: feature Name = feature 1 AND feature Name = feature 3 and feature_name = feature 4. exclude activity .

 

What I am trying to achieve?

  1. My workflow has deduplicate activity and a recipient can purchase one feature and second time a different feature on the same day. then the recipient gets filtered out ?
  2. how can i achieve the dynamic content based up on the features purchased?

Thank you in advance

 

 

Avatar

Community Advisor

hello @rvnth,

i did aanswer this on the duplicate question you have made

"Simply in enrichment add all three features as data linked to the targeting dimension return 1 row add conditions to bring each feature separatelly.

Then on the delivery you can simply set conditions to display what you need. The result from the enrichment should give you 3 columns with either empty value or populated value. this will let you know what feature recipient has got and which you will display on the email.

 

In email template you use if conditions to display what you need"

 

Marcel

Avatar

Level 6

Thank you @Marcel_Szimonisz , I am getting the data as required but came across another challenge. Please find below

 

rvnth_0-1702555857842.png

 

if (targetData.featureTabel1.FEATURE_NAME == 'Feature1') {

}

if (targetData.featureTabel2.FEATURE_NAME == 'Feature2') {

}

if (targetData.featureTabel3.FEATURE_NAME == 'Feature3') {

}

 

The order of the features purchased may vary. Currently, the issue arises if the recipient1 purchases feature3 first, which populates targetData.featureTabel1 first, then feature2, and lastly feature1. Feature sorting has been implemented to display the relevant blocks in the HTML email.

 

However, there is a scenario where if a user purchases only one feature, for example, feature3, it will be placed in targetData.featureTabel1 first. This causes a failure in the if condition.

 

Seeking suggestions on how to handle this situation. Thank you in advance.

Avatar

Level 6

Hi @Marcel_Szimonisz , 

 

I found a fix by adding the below condition and it's working as expected. Thank you for your help. 

 

if (targetData.featureTabel1.FEATURE_NAME == 'Feature1' || targetData.featureTabel2.FEATURE_NAME == 'Feature1' || targetData.featureTabel3.FEATURE_NAME == 'Feature1') {

}