Skip to content

How to use a conditional in an email

This article shows you how to add a conditional to a component, subject or preheader, so different recipients see different content.

A conditional splits content into branches, one for each group of recipients. For example, a loyalty program email might have a gold members branch, a silver members branch and an everyone else branch. You write the content for each branch, and when the email is exported, EmailShepherd adds the ESP code that decides which branch each recipient sees.

You can use a reusable conditional that’s already set up in your workspace, or set up an inline conditional just for this email. To set up a reusable conditional, see How to create a conditional. That article also explains how branches and syntax work.

When you add a conditional to a component, EmailShepherd creates a copy of the component for each branch. You can then edit each copy separately.

  1. Open the email and open the component.

  2. Click the pie chart icon (Conditional settings).

    The conditional settings icon on a component

  3. In Choose conditional, select the type of conditional:

    • Reusable conditional: use one that’s shared across your workspace. Choose it from the list.
    • Inline conditional: set one up just for this email. See Set up an inline conditional.

    Choosing between no conditional, a reusable conditional and an inline conditional

  4. Click Save. The component list and the preview now show a copy of the component for each branch.

    The component list showing a copy of the component for each branch

  5. In the component list, select each branch and edit its content.

The preview showing a copy of the component for each branch

To remove the conditional, open Choose conditional again and select No conditional.

Add a conditional to a subject or preheader

Section titled “Add a conditional to a subject or preheader”

The list of reusable conditionals only shows the ones set up to be used in a subject and preheader.

  1. Open the email and select the Settings tab.

  2. Click the pie chart icon (Conditional settings) beside the subject or preheader.

    The conditional settings icon beside the subject

  3. In Choose conditional, select Reusable conditional and choose one from the list, or select Inline conditional and set one up.

  4. Click Save.

  5. Enter the subject or preheader for each branch.

Entering a different subject for each branch

An inline conditional is set up in the email and only used there. You set it up from Choose conditional, after selecting Inline conditional.

  1. Under Branches, enter a label for each branch, e.g. “Gold members”. Click Add branch to add another one.
  2. Under Syntax, enter the syntax that starts each branch, then the closing syntax.
  3. If you export to more than one ESP and one needs different syntax, select that ESP’s dynamic content profile tab, click Customize syntax and enter the syntax. To go back to the default, click Use default syntax.
  4. Click Save.

Setting up the branches and syntax for an inline conditional

If you’ll need a similar inline conditional in other emails, save it as a template to start from next time.

  1. Below the branches, click Save as template.
  2. In Name, enter a name for the template.
  3. Click Save template.

To start from a template, click Copy from a template and choose it from the list. This copies the template’s branches and syntax, which you can then change without affecting the template.

Choosing a template to start an inline conditional from

To delete a template, click the delete icon beside it in the list.

By default, the preview shows every branch. To check what one group of recipients will see, see How to preview personalization tags and conditional content.