Personalization and Templates

Templates help you create messages quickly and provide a mechanism to personalize your messages for your audience. For email, you can also create templates using our WYSIWYG editor.

When you create a template, you set a design and message that you can resend. The way in which you personalize messages or create templates varies by channel and, in some cases, your audience. Templates support variables (merge fields) that you can populate with personalized information for each individual recipient when you upload a list of users.

Personalizing Messages with Templates

Templates help you create reusable messages that you can personalize with HandlebarsAirship’s message personalization syntax using double curly braces ({{handlebars}}). You can use handlebars to insert variables and conditional logic in messages and templates. and populate with information relevant to each individual member of your audience when you send a message. You can create templates for any channel, though rules for using templates vary per channel.

For app and web channels, you can use a template when:

  • Creating an automation with the Custom Event trigger.
  • Creating a message in a journey that uses a Custom Event trigger.
 Note

You can create app templates for push notifications and message center messages.

For SMS, MMS, email, and open channels, you can use a template when:

  • Creating an automation with the Custom Event trigger.
  • Creating messages in a journey that uses a Custom Event trigger.
  • Using the Upload Users Audience option.
  • Invoking the template in the /create-and-send API.

When using a template to send a non-automated message, you will upload your audience information and personalization data in a CSV-formatted list when you create your message. Column titles in your list (or properties in the create-and-send audience object in the API) that are not prefaced with ua_ are considered merge fields corresponding to variables in your message. For example, if your template has a {{name}} variable, then the CSV list should contain a name column.

When using templates with AutomationA set of conditions that your audience must meet before they receive a message. or JourneysA series of messages that is initiated by a single automation trigger. Airship sends messages in the series based on your timing settings, and you can also set conditions that determine the continuation of the series. , you will use the Custom Event trigger and configure your template to access event properties in the $data.events.[0].properties namespace. For example, if you wanted to use an event property called name in your message, you would use {{$data.events.[0].properties.name}}. When the corresponding event is received by Airship, Airship sends the message with the name property from the incoming event. See Custom Event Properties for more information.

In both cases you can also use HandlebarsAirship’s message personalization syntax using double curly braces ({{handlebars}}). You can use handlebars to insert variables and conditional logic in messages and templates. to include dynamic content in your templates and personalize messages for each member of your audience based on the variables you include in your user list. For example, you could use the {{#each}} operator to loop through and include a list of products in an email updating a user about their recent order.

 Tip

You may want to label your automation templates to differentiate them from non-automation templates. Because you personalize automated messages with variables in a different namespace than non-automated messages, you wouldn’t want to reuse a template designed for automation in a standard message.

Email Template WYSIWYG Editor

Airship’s drag-and-drop WYSIWYG editor helps you assemble HTML emails and templates for email without having to write HTML yourself. The editor produces HTML that is compatible with any email client that accepts HTML emails, making sure that your audience sees the best version of your message. As new versions of Outlook and other clients are released, we make sure both your templates will work with them too.

You can choose one of Airship’s default email templates to get started, or you can create your own design using a Blank Template. Default templates are fully editable.

Personalizing Messages Without a Template

You can take advantage of Airship’s handlebar syntax in Automation messages, or in other situations when you cannot use a template.

You can use handlebars when:

  • Sending a message using the Upload Users Audience option or the /create-and-send API. In this case, your conditions and variables are populated from the list of users you upload or from the create-and-send audience object in the API.

  • Sending an automation or journey using the Custom Event trigger. In these cases, your conditions and variables are populated from properties in incoming custom events. You can access custom event properties in your messages and templates using the {{$data.events.[0].properties}} namespace.

Dynamic Content and Merge Fields

You can use Airship’s handlebarAirship’s message personalization syntax using double curly braces ({{handlebars}}). You can use handlebars to insert variables and conditional logic in messages and templates. syntax to personalize templates and messages based on information that you associate with your audience. When you send a message, Airship evaluates the conditions in your template or message, and issues personalized Dynamic ContentVariable message content using handlebar syntax that you populate at send time. Use dynamic content to personalize messages for each member of your audience. to each member of your audience.

When you send a message, set up an automation, or set up a journey, you will provide the variables that you referenced in your message template by CSV, in the API payload, or from an incoming custom eventA trigger that initiates an automation or journey when a custom event associated with members of your audience occurs. .

  • For SMS, email, and open channel messages, you will associate information directly with each user using a CSV or a /create-and-send API payload.
    • Sending a message using the Upload List Audience option: You will upload a CSV containing your message audience and variables associated with each audience member. You can access variables in the list as merge fields.
    • Sending a message using the /create-and-send API: Each object in the audience.create_and_send array represents an audience member and variables you want to associate with each audience member. You can access variables here as merge fields in your message.
  • For automations and journeys directed at any channel, you will trigger your message using a custom event that contains properties relevant to each member of your audience. You can reference your custom event’s properties in the {{$data.events.[0].properties}} namespace.

Dynamic content uses handlebar syntax:

{{#eq merge_field "string value"}}
    If merge_field contains "string value", this string will appear!
{{/eq}}

Merge fields are the most basic form of Dynamic ContentVariable message content using handlebar syntax that you populate at send time. Use dynamic content to personalize messages for each member of your audience. . When creating a template, or a message that you want to personalize, you can add merge fields by wrapping a variable name in double curly braces — {{merge_field}}.

When you send your message, you will uploading an audience list, or construct a create-and-send audience payload, with data corresponding to merge fields in your message.

For more information about Airship’s handlebar syntax and how to use handlebars in your templates, see Handlebar Syntax and Dynamic Content.

Resources