Merge fields in the Interactive editor

Add merge fields, conditionals, and looping fields in the Interactive editor.

View as Markdown

You can add Merge FieldsA variable in your message or template that you want to populate with a personalized value for each member of the audience. Merge fields use Handlebars syntax — {{merge_field}}. when using the drag-and-drop option in the Interactive editor.

When you create a merge field, you set its field logic, which determines both how you use the field and the options you have when you use the field in a message:

Merge fields, conditionals, and looping fields make it easier to take advantage of Dynamic ContentVariable message content created using Handlebars syntax. The content is populated at send time, resulting in personalized messaging for each member of your audience.. Merge fields are not supported for Email Preference CentersA page where users can manage their opt-in statuses for the Subscription Lists in your project. Preference Centers are presented within your app or website or as an Airship-hosted web page..

Tip

You can also take advantage of looping (#each), conditional (#if), and other advanced HandlebarsHandlebars is Airship’s templating language for personalization. Handlebars expressions use double curly braces wrapped around a content template, ranging from a simple variable, e.g., {{first_name}}, to complex evaluations of personalization data. within HTML content to show or repeat text. However, you cannot apply conditional or looping logic to block-level elements in your layout without adding merge fields to your layout.

Creating and editing merge fields

Create or edit merge fields when editing layouts:

  1. Select Merge fields in the header of the editor.

  2. Select Create field to add a new field or the edit icon () to edit an existing field.

  3. Enter a Field Name. This is the name you’ll see in the editor.

  4. Enter the Key Path. This is the path to the variable that you want to use.

  5. Make a selection for Field Logic

  6. Select Save.

  7. Select Done to return to the editor.

Using merge fields

The way you use a merge field depends on its logic: None, Conditional, or Loop.

None

You can insert merge fields set to None into any Text content element, and Airship will add your merge field with the correct syntax in your text:

  1. Select the Text content element that you want to add a merge field to, and a toolbar will appear.
  2. Select Merge Tags from the toolbar, and select a merge field.

Conditional and Loop

Merge fields set to Conditional and Loop apply to a row. You use the merge field to determine whether you want to show, hide, or repeat the entire Text content element.

While conditions apply at the row level, you can still use merge fields within your conditional block. If you want to use a field both as a block-level condition and as a value within a block, you should save two merge fields: one to represent the conditional usage of the field, and one with field logic set to None.

When you apply a looping merge field to a content block, you can reference the current instance of the loop with the this context. For example, if looping through an array of products in your audience’s shopping cart, you might reference the price for each product in the loop with {{this.price}}.

To set conditional or looping logic:

  1. Select the row you want to apply the logic to and select Merge Tags .

  2. Select a merge field and select from the available options:

    Conditional

    • Show if condition is false — Displays the block if the field does not exist, is empty, or is null.
    • Show if condition is true — Displays the block if the field exists and is not an empty string or null value.

    Looping

    • Repeat for each — Repeats the block for each item in an array.
    • Show if there are none — Displays the block if the key path is empty or does not exist.
    • Show if there are any — Displays the block if the key path exists and has at least one item in the array.
  3. Choose Select.