Forum Discussion
Randomize or changing copy each time customer enters the same canvas
Hey Sofia,
You could use if/then logic in Liquid to look at a custom attribute and tailor the subject line (or any content) based on that custom attribute. Let me explain:
Let's create a custom attribute called "WelcomeEmailContentVersion" and set the type as a number. When someone enters this canvas for the first time that value will be null, so you'd need copy for when that value is null, 1, 2, etc.
Create your email, and use Liquid to build out your list of subject lines. There are a few ways you could dev the liquid snippet, if/then logic, or a case statement event, but could look something like this:
{% if custom_attribute.${WelcomeEmailContentVersion} == '1' %}
Subject Line 1
{% elsif custom_attribute.${WelcomeEmailContentVersion} == '2' %}
Subject Line 2
{% elsif custom_attribute.${WelcomeEmailContentVersion} == '3' %}
And on and on
{% else %}
Subject Line for the null value on first entry
{% endif %}
Immediately following your email step, add the User Update step and configure it like this:
- Attribute Name: WelcomeEmailContentVersion
- Action: Increment By
- Increment By: 1
So now the next time a subscriber enters this canvas, the custom attribute WelcomeEmailContentVersion will be the previous value plus 1.
This wouldn't make it random, but it would keep the user from receiving the same SL over and over again. The ELSE subject line would be what they receive on the first entry and then any entry beyond the 10th if you configure the Liquid to have 10 subject lines.
Similarly, you could pair this solution with a Catalog of subject lines to have a long list of subject lines in one central location that's easy to update, and keep then Liquid logic pretty simple to just look up a SL based on what your incrementing custom attribute is. You'd keep using the incrementing User Update step in the Canvas but you wouldn't have to update the email HTML and Liquid if you want to update the subject lines.
Hope that helps!
Cool! Thank you Jake!
Related Content
- 2 years ago
- 7 months ago
- 2 years ago
- 5 months ago