Skip to main content

Creating a conditional

Conditionals are what allows you to show different content to different recipients, based on properties of the recipient.

E.g. perhaps your business has a loyalty membership program with gold and silver tiers - perhaps you want to show different content to gold and silver members.

To create a conditional, navigate to Dynamic Content > Conditionals > Add conditional.

First choose a label for your conditional. This is the label that will appear in the email builder, e.g. Membership tiers. You then need to define the branches. For this example, we will create three branches:

  • Gold membership
  • Silver membership
  • Else (for non-members)

For each branch enter the branch label and branch key. The branch key is the unique identifier of the branch within the conditional.

note

If you make changes to conditionals that are already in use in emails (e.g. adding a new branch) you will want to ensure the branch key for any existing branch stays the same, or the content stored under that branch will be lost.

Example:

Branch LabelBranch Key
Gold Membershipgold_membership
Silver Membershipsilver_membership
Elseelse

Conditional branches

Now you must enter the default syntax, as well as the syntax for any dynamic content profiles you may have.

The syntax is different for each ESP, you will need to check your ESP(s) documentation to see what their syntax looks like.

For example for Braze, the syntax you would enter looks something like:

{% if {{custom_attribute.${membership_tier}}} == 'gold' %}

gold_membership Branch content

{% elsif {{custom_attribute.${membership_tier}}} == 'silver' %}

silver_membership Branch content

{% else %}

else Branch content

{% endif %}

Conditional syntax

You will want to repeat this process for any Dynamic Content Profiles you have (if any).