Conditional text is a great way to personalize content to your contacts.
You can use Conditional Text for displaying different text content to different audiences. Audiences can be defined based on certain conditions that can be applied to contacts.
You can set up the audiences in the UI by setting the conditions related to contact data. You can read more about how to set up Conditional text in the UI here.
Writing Conditional Tex with ESL
In ESL writing Conditional Text is possible via adding IF statements.
For example:
{% if contact.5 == 2 %}
We have a wide range of skirts and high heel shoes that are perfect for any occasion.
{% elseif contact.5 == 1 %}
Check out our collection of suites and ties that are perfect for business casual and family events as well.
{% else %}
We are excited to see you soon!
{% endif %}
In this code snippet we stated that if the gender of the contact (contact.5) is female, then that particular contact should see the content “We have a wide range of skirts and high heel shoes that are perfect for any occasion.” If the gender is male, then they should see “Check out our collection of suites and ties that are perfect for business casual and family events as well.” If it is not applicable, then they should see “We are excited to see you soon!”.
This is how Conditional Text written in ESL looks in the editor:
This is how it looks in the rendered email for females:
This is how it looks in the rendered email for males:
And this is how it looks for non applicable genders: