All Collections
Advanced
Electronic Direct Mail (EDM)
Reference
How to create if/else logic statements in your EDMs
How to create if/else logic statements in your EDMs

If you want to use one EDM to display different things based on some logic you create, you can add in if/else statements.

Updated over a week ago

If/else logic statements can be used to say IF venue is "abc" show this - or IF facility is "xyz" show that for example.
​
See below for some information on how to build if else statements.
​
Noting the 'venue_name' used in the examples below can be replaced with any of the Event Hub merge tags to do comparisons on.

Create an if/else statement to show different text based on the venue name

Noting the venue name must match exactly

{% if venue_name == "Accor Stadium" %}
This is Accor

{% elsif venue_name == "Commbank Stadium" %}
This is Commbank

{% elsif venue_name == "Sydney Cricket Ground" %}
This is SCG

{% else %}
This will print out if none of the conditions above are met (final in a set)

{% endif %}

Create an if/else Statement to show different text depending on whether the venue name contains certain text

{% if venue_name contains "Stadium" %}
This is a Stadium

{% elsif venue_name contains "Arena" %}
This is an Arena

{% else %}
This will print out if none of the conditions above are met (final in a set)

{% endif %}

See more on what operators can be used in logic statements:


​

Did this answer your question?