Skip to content

Defining conditionals

Conditionals allow you to show different content to different recipients based on properties of the recipient. For example, a loyalty program might show different content to gold members, silver members, and everyone else.

Conditionals defined in the Dynamic Content menu are reusable. Define them once, then use them in any email.

Sometimes you only need a conditional as a one-off. In that case, use an inline conditional. Inline conditionals can also be saved as templates, so you can reuse one as a starting point in another email.

TypeWhere it is definedWhen to use it
Reusable conditionalUnder Dynamic Content > ConditionalsWhen the same logic will be used across multiple emails or components
Inline conditionalDirectly within the email editorWhen the conditional is only needed for one email

Both reusable and inline conditionals consist of branches and syntax.

Add a branch for each version of the content that you want to create. Give every branch a unique, descriptive label.

Enter the syntax that your ESP uses to begin each branch, followed by the closing syntax. EmailShepherd adds this syntax around the corresponding branch content in the exported email.

For example, a Liquid conditional might use:

{% if membership == "gold" %}

Gold members branch content

{% elsif membership == "silver" %}

Silver members branch content

{% else %}

Everyone else branch content

{% endif %}

If your workspace has Dynamic Content Profiles, you can define different syntax for each profile. This lets the same conditional export correctly to ESPs that use different template languages or syntax.

Each profile uses the default syntax unless you provide an override for that profile.

Reusable conditionals are available throughout the workspace and can be updated centrally.

  1. Navigate to Dynamic Content > Conditionals > Add conditional.
  2. Enter a label, such as Membership tiers. This is the name that will appear in the email editor.
  3. Add the branches and enter a label and branch key for each one. The branch key is the unique identifier of the branch within the conditional.

For example:

Branch labelBranch key
Gold membersgold_membership
Silver memberssilver_membership
Everyone elseelse

Defining a reusable conditional and its branches

  1. Enter the default syntax for each branch and the closing syntax.

Defining the syntax for a reusable conditional

  1. If you use Dynamic Content Profiles, enter any profile-specific syntax.
  2. If the conditional will be used in a subject or preheader, select Can be used in subject and preheader.
  3. Save the conditional.

Inline conditionals are defined while building an email. See Using conditionals in an email for the complete editor workflow.