With Airship, you have the ability to customize your message to each member of your audience by using dynamic content.
You can personalize messages using:
-
Properties from a Custom Event that triggers a journey or automation rule
-
External Data Feeds (personalization data from an external API)
Please note that message customization is not available for tags!
A - How to declare content variables
a) Customization with values
To send custom content to your users, you will need to use handlebars.
Airship will parse the dynamic field and associate it to the data in the database.
Handlebars are defined as the following, for instance with the attribute “first_name” : {{first_name}}
b) Customization using a default value
Please note that we recommend setting up a default value, in case the attribute’s value doesn’t exist.
By setting a default value, you will make sure your users receive content and not a blank space.
Use the following variable to set it up : {{$def first_name "you"}}
In the example above, if the “first name” is not populated in the attribute, the value “you” will be displayed.
If you are willing to use the default value format of variable, it will not be necessary to use the standard format {{first_name}}.
c) Customization using operators
Airship provides you with other operators that can be used with dynamic content. You can find all of them within the following documentation: Basic Syntax and Merge Fields which includes the following:
-
If/Else Statements
-
Unless — The Negative If Statement
-
Equality Operators
-
Greater Than and Less Than
-
Combining Operators
-
Object and Array Notation
-
Setting Context Using #with
-
Using a Feed
-
Loop Through Objects and Arrays
-
Math Helpers
-
Format Dates and Times
B - Personalization from the Airship Interface
a) Message Templates
You have the ability to create default message templates in which all your dynamic fields will be specified. This will help you send your push more efficiently when creating your message.
Your templates can be invoked directly from the “content step” in any push creation.
Visit the following documentation to learn how to create your templates: Create Message Templates
b) Dynamic fields in push content
If you don’t have any predefined templates, you may directly specify the dynamic fields in the content section during your push creation.
C - Personalization via the API
Sending a push with dynamic content from the API will require you to create a Message template (check section A-1) which you will be able to invoke with the template_id.
The template_id, can be called with the API endpoint GET : /api/templates or directly from the Airship interface, by going to Messages > Templates.
Within your API body, you have the ability to set up substitutions that will override the default values.
Please note that if no default value is defined, a substitution will be mandatory
Visit the following technical documentation section for all the information: Push to Template.
Please feel free to reach out to our Support team if you have any additional questions.