Variables and sample values in templates
Use numbered variables in a template, give WhatsApp sample values, and fill the variables in when you send.
On this page
A variable is a numbered gap in a template, written {{1}}, {{2}} and so on. You decide what goes into each gap when you send the template, so one approved template can address each customer by name or carry a different date or amount.
Add variables when you write the template
- On the New template page, click in the Message box where the detail should appear.
Click Insert variable.
Chatilo adds the next number:
{{1}}first, then{{2}}.- You can also type a variable by hand, for example
Hi {{1}}, your order {{2}} is ready.
Number the variables in order, starting at {{1}}, with no gaps.
Give a sample for each variable
When the message contains variables, a Sample for field appears for each one. Type an example of what will go there, such as Grace for a name or 12 March for a date.
- The samples go to WhatsApp with the template so its reviewers can understand the message.
- The preview on the right shows the samples in place of the variables.
- Customers never see the samples.
- If you leave a sample empty, Chatilo sends the word "Sample" to WhatsApp instead.
A variable in a text header
A Text header can contain one variable, {{1}}. There is no sample field for a header variable; Chatilo sends "Sample" as its example.
Fill the variables in when you send
When you choose the template for a broadcast or in the inbox, Chatilo shows a Value for field for each variable. In each field you can type:
- a fixed value that is the same for everyone, for example
Friday - a contact placeholder, which is replaced with each contact's own details
| Placeholder | Replaced with |
|---|---|
{{first_name}} | The first word of the contact's name, or "there" if the contact has no name |
{{name}} | The contact's full name, or "there" if the contact has no name |
{{phone}} | The contact's phone number |
{{email}} | The contact's email address |
{{city}} | A custom field called city. Any custom field name made of letters, numbers and underscores works the same way. |
The field for {{1}} is filled in with {{first_name}} to begin with. Change it if your first variable is not a name.
You can mix text and placeholders in one field, for example {{first_name}} from {{city}}.
Common problems
A customer received a dash where a detail should be
WhatsApp does not accept an empty variable. If a value ends up empty for a contact, for example a custom field that this contact does not have, Chatilo sends - in its place. Check that every contact in the audience has the field, or use a fixed value.
A placeholder for a custom field stays empty
The placeholder must match the field name exactly, including capital letters. Field names that contain spaces or other symbols cannot be used as placeholders; rename the field on the contact using letters, numbers and underscores.
WhatsApp did not accept the template because of its variables
See the list of causes under "WhatsApp didn’t accept the template" in Create a template.