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 Handlebars Airship'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 apps and web notifications, you can use a template when:

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

App templates are limited to push notifications. You cannot create a template for message center or in-app messages.

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

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

For open channels, you can use a template when:

  • Using the /pipelines API with a Custom Event trigger.
  • 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 Automation A set of conditions that your audience must meet before they receive a message. or Journeys A 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.

 Note

You can only use a template, or handlebar Airship's message personalization syntax using double curly braces ({{handlebars}}). You can use handlebars to insert variables and conditional logic in messages and templates. syntax, with the first message in a journey. You cannot access event properties for subsequent messages in your journey.

In both cases you can also use Handlebars Airship'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 templates for email without having to write HTML yourself. The editor produces templates that you can be sure will work for any audience member and email client that accepts HTML emails. If and when new versions of Outlook and other clients come out, we make sure both your new and existing templates will work with them too.

You can choose an Airship default template to get started, or you can create your own design. While the default templates can help you visualize your email and layout, they are still fully editable.

 Note

While you cannot personalize messages using handlebars and dynamic content in the WYSIWYG email editor, you can switch to the custom HTML editor after you save your template and use handlebar syntax in the raw HTML. If you edit your WYSIWYG-created template's HTML, you will no longer be able to edit it with the WYSIWYG editor.

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 using the Custom Event trigger. In this case, your conditions and variables are populated from properties in incoming custom events. You can access custom event properties in the {{$data.events.[0].properties}} namespace.

Dynamic Content and Merge Fields

You can use Airship's handlebar syntax to personalize templates and messages based on information that you associate with your audience. Airship evaluates conditions in your message, and issues personalized, Dynamic Content Variable 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.

You can use handlebars to personalize templates. When you send a message based on a template, you will provide the variables that you want to populate for each member of the audience — either by uploading a CSV, or in the payload of a /create-and-send operation.

You can also use handlebars to personalize messages without a template when:

  • Creating an Automation using the Custom Event trigger.You can personalize automated messages using properties from your automation's custom event trigger. Access properties in the event in the {{$data.events.[0].properties}} namespace.
  • 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.

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 Content Variable 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