Content Templates

Use content templates to personalize messages with information specific to each member of your audience, like first name, flight number, or order status. You can even pass complicated variables to your template.

About content templates

You can create content templates for all messaging channels:

  • App
    • Select the App template to create push notification content.
    • Select the Message Center template to create Message Center content.
  • Web
  • SMS
  • Email
  • Open channel

After creating content templates in the dashboard, you can select them in the Content step in a composer or by using the template property with the API.

In the composers, for App, Web, SMS, and Open channels, the template content replaces your message content as-is; for Message Center and Email, you can edit your message content after selecting the template.

Content template format

A content template has a name, optional description, and fields that make up the viewable content in a message.

TemplateFields
App (Push notification)
  • Message text — The text that will display in your push notification.
  • Title — A heading that appears above the notification text when applicable.
  • Summary — Supplemental text displayed with the notification.
    • iOS 10 and later: The summary appears below the push notification title. See: iOS 10 documentation.
    • Android and Amazon: The summary appears below the main notification text in most cases. This is the only visible text other than the title when Android Picture is visible in expanded mode, as the main notification text is suppressed. See: Android documentation.
Web
  • Alert — The text that will display in your web push notification.
  • Title — A heading that appears above the message.
SMS
  • Message text — The text that will display in your SMS message.
Email
  • Subject — A meaningful subject to summarize your email.
  • HTML body — The HTML body of your email, created using the Interactive EditorA tool for creating content for landing pages, Message Center, and email. You can provide your own HTML or design using the drag-and-drop WYSIWYG option. .
  • Plain text body — The plain-text version of your message, for use when HTML is unavailable.
Open channel
  • Alert — The text that will display in your open channel message.
  • Summary — Supplemental text displayed with the notification.
  • Title — A heading that appears above the notification text when applicable.
  • Media attachment URL — The URL for media you want to include in your message.
Message Center
  • Title — A heading that appears above the message and in the Message Center inbox.
  • Message body — The HTML body of your message, created using the Interactive EditorA tool for creating content for landing pages, Message Center, and email. You can provide your own HTML or design using the drag-and-drop WYSIWYG option. .

Using the Interactive editor

When adding the email HTML body or Message Center Message body, you can use the Interactive EditorA tool for creating content for landing pages, Message Center, and email. You can provide your own HTML or design using the drag-and-drop WYSIWYG option. to:

  • Upload your own HTML.
  • Design using the WYSIWYG option. You can start from a blank layout, or select an Airship default layout or a layout you saved. The WYSIWYG editor supports 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 handlebar syntax — {{merge_field}}. , so you can personalize your message for your audience.

Personalizing content templates

You can use HandlebarsAirship’s message personalization syntax using double curly braces, more commonly known as {{handlebars}}. Use handlebars to insert variables and conditional logic in messages and templates. and External Data FeedsA connection to an external API. When you send a message, Airship uses a response from that API to personalize messages. to insert 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 handlebar syntax — {{merge_field}}. and 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 personalize messages for each individual member of your audience. See the WYSIWYG Editor for details about using personalization in the email HTML body and Message Center Message body.

When adding or editing content that contains handlebar syntax, you can enter JSON sample data representing a member of your audience to test any 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. statements, without having to send test messages.

  • For non-Automation Templates: Enter a JSON object representative of an audience member. Click Example to see a sample object that can help you format your JSON data. This object mirrors the create_and_send audience object.
  • For Automation Templates: Enter custom event properties representative of an audience member, mirroring the properties object in a custom event.

Sample custom event
{
    "occurred": "{{event_time}}",
    "user": {
        "named_user_id": "user"
    },
    "body": {
        "name": "purchase",
        "subscribe": true,
        "properties": {
            "customer_name": "user",
            "total": 48,
            "cost_units": "USD",
            "purchase": [
                {
                    "qty": 4,
                    "item": "MLB regulation baseball",
                    "per": "$12",
                    "total": "$48"
                }
            ]
        }
    }
}

Example automation template JSON
{
    "total": 48,
    "cost_units": "USD",
    "purchase": [
        {
            "qty": 4,
            "item": "MLB regulation baseball",
            "per": "$12",
            "total": "$48"
        }
    ]
}

Create a content template

  1. Click   and select Template, or go to Messages » Content » Templates and click Create content template.

  2. Enter a Name and a brief Description to help you identify the template in lists (e.g., “Holiday 2020”), select the Template Type, and click Save and continue.

  3. Enter your content. The preview updates as you type. Open channel templates do not have a preview.

    Click Add   and add content for each field, then click Done. For personalized content, enable Sample data and enter a JSON object representing a member of your audience. The message preview updates to show what your message will look like when populated with data.

    For email HTML body and Message Center Message body, provide your HTML or design using the WYSIWYG editor.

    • For HTML, click Paste HTML or Upload HTML file, and add your HTML.
    • For the WYSIWYG editor, select a default or saved layout, or select Blank Layout to design your own; you can edit any layout after selecting. Then design your message. See the WYSIWYG Editor for details.
     Note

    When using handlebars to reference variables, you should define default values for your variables with {{ $def variable_name "default value" }}. The preview represents variables without default values as blank spaces, mimicking the behavior your audience will experience if they receive messages with unpopulated variables.

  4. (Optional) Preview your email in different clients.

    1. Click Inbox preview.
    2. Select from the lists of browser, desktop, and mobile clients, then click Generate previews.
    3. Click a thumbnail to see the full version. Click   to close and choose another preview.
    4. (Optional) To add/remove clients, click Reselect and generate previews and start over.
    5. When you are finished with inbox previews, click   to close the modal.
  5. Click Save template when you are done adding content.

Reference a content template

You can select a template in a composer’s Content step. For Message Center and Email, you can edit your message content after selecting the template.

In the API, you can use a template property to invoke a template, either by ID or to personalize your message with HandlebarsAirship’s message personalization syntax using double curly braces, more commonly known as {{handlebars}}. Use handlebars to insert variables and conditional logic in messages and templates. . If you want to reference templates by ID, you must get the ID from Messages » Content » Templates in the Airship dashboard.

Manage content templates

Messages » Content » Templates lists your templates. Templates marked Empty do not have message content; you cannot use Empty templates in messages until you edit and populate them.

  1. Go to Messages » Content » Templates.
  2. Find the template you want to manage. You can search by name, type, or ID.
  3. Click an icon to make changes.
    •   = Edit
    •   = Duplicate
    •   = Delete