Hi Team,
I have a features table that generates a new record for a recipient when they purchase 1 or 2 features, like this:
Recipient 1 - Feature 1
Recipient 1 - Feature 2
I need to trigger an email with dynamic conditions based on the purchased features. The email should display content blocks for features that were not purchased. For example, I want to trigger an email for Recipient 1 with Feature 3 included.
I'm unsure how to group the features (Feature 1, Feature 2) when querying in query activity.
Do I need to use an enrichment activity.
Send them as a single record in the email. The email should check:
In this specific case, the email should include Feature 3. Please provide suggestions, and let me know if further clarification is needed.
Thank you in advance.
Solved! Go to Solution.
Topics help categorize Community content and increase your ability to discover relevant content.
Views
Replies
Total Likes
Hello @rvnth,
I do not know where the other post with same issue went. But since you told me its related table with 1 to many relation.
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 you simply use if conditions
Marcel
Can I use String aggregate function in the expression of the query activity here? but still unsure how to pass these values in to email.
Views
Replies
Total Likes
Hi @rvnth ,
In the initial query, you can select all those recipients who have at least 1 feature missing. If its a linked table use "Included in" operator. Or link the table in the next enrichment, and use a split to refine which recipients have at least 1 feature missing.
Next, you can use a split to segment out which features are missing for the group of recipients.
Segment1 - Feature 1 is missing - segmentCode "Feature1"
Segment2 - Feature 2 is missing - segmentCode "Feature2"
You can use this segment code to display dynamic content in Email.
Or in case of too many features you can write the code through Content Block.
Hope this helps!
Hi @vt0509 ,
At present, in the feature table one recipient can have multiple features or only one feature
For suppose if a recipient has purchased two features :
recipient 1 feature 1
recipient 1 feature 3
It has to send only one email which should be feature 2 but the current setup is in such a way that it will send two emails with feature 2 & feature 3
and 2nd email
feature 2 & feature 1
Please let me know if it was clear.
Thank you in advance
Views
Replies
Total Likes
Hello @rvnth,
I do not know where the other post with same issue went. But since you told me its related table with 1 to many relation.
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 you simply use if conditions
Marcel
Thank you @Marcel_Szimonisz , I am getting the data as required but came across another challenge. Please find below
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.
Views
Replies
Total Likes
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') {
}
Views
Replies
Total Likes