How to design simple iOS Push template with click action and image.
Handlebarsjs
language. You can check how the message will look in the preview section on the right side. Once designed, you can save the push notification template by clicking on Save Draft. When you are ready, you can Publish Draft by providing a name to the version. This will become the Live version, and will be used whenever the associated workflow is triggered.
Field | Description |
---|---|
Title | Small message text box. Note that this field will be displayed in single line only, and very long content can get curtailed. Use handlebarsjs to add variables. |
Body | Large message text box. Use handlebarsjs to add variables. |
Declaring Variables in the global `Mock data` button
Mock data
button. To see how to declare variables before using them in designing templates, refer to this section in the Templates documentation.Using variables in the templates
handlebarsjs
to add variables in the template. As a general rule, all the variables have to be entered within double curly brackets: {{variable\_name}}
If you have declared the variables in the global Mock data
button, then they will come as auto-suggestions when you type a curly bracket {
. This will remove the chances of errors like variable mismatch at the time of template rendering.Note that you will be able to enter a variable name even when you have not declared it inside the Mock data
button. To manually enter the variable name, follow the handlerbarsjs guide here.Below is an example of how to enter variables in the template design. For illustration, we are using the same sample variable names that we declared in the Templates
section:{{var1.var2.var3}}
. E.g. to refer to city in the example above, you need to enter {{event.location.city}}
{{var1.[*index*].var2}}. E.g. to refer to
product_nameof the first element of the array
array, enter
{{array.[0].product_name}}`
{{event.[first name]}}
Mock data
button.
handlebarsjs
guideline.