EmailBison supports Liquid Templates, allowing you to create dynamic email copies.
For a full overall guide on Liquid Templates, you can read the official docs here: https://shopify.github.io/liquid/
One caveat is that Bison replaces custom variables before parsing your liquid templates. This means that if you’re using custom variables, and you’re looking to make comparisons in “if” statements, you must put them in quotes.
Example below.
{% if '{FIRST_NAME}' == 'Cody' %}
This is Cody
{% elsif '{FIRST_NAME}' == 'John' %}
This is John
{% else %}
This is not Cody or John
{% endif %}
You can chain as many elsif
statements as you like. If you are doing one comparison only, you should omit the elsif
and use else
for any case where the comparison did not pass.
An alternative way of doing this would be to assign a temporary inline variable, and then you can reference the variable inside your template without quotes.
The example below is the same as the one above, but now uses a temporary in-line variable.
{% assign first_name = {FIRST_NAME} %}
{% if first_name == 'Cody' %}
This is Cody
{% elsif first_name == 'John' %}
This is John
{% else %}
This is not Cody or John
{% endif %}
It’s a matter of preference which you choose.
You can also use other parts of liquid templates, for example, custom date handlers.
Example from one of our customers:
{% assign today = "now" | date: "%A" %}
{% if today == "Monday" %}
tomorrow or Wednesday?
{% elsif today == "Tuesday" %}
tomorrow or Thursday?
{% elsif today == "Wednesday" %}
tomorrow or Friday?
{% elsif today == "Thursday" %}
tomorrow or early next week?
{% elsif today == "Friday" or today == "Saturday" or today == "Sunday" %}
early next week?
{% endif %}
If you need any help with Liquid Templates, please reach out to your dedicated support rep.