Templates
Templates holds the messages you send often. Write a message once with variables, and each recipient gets their own name and fields filled in. A campaign can use a template instead of a message written in the builder.
Variables
Section titled “Variables”Variables go in double braces. These are the only ones a message can use:
| Variable | Filled with |
|---|---|
{{first_name}} |
The contact’s first name |
{{last_name}} |
The contact’s last name |
{{custom.<key>}} |
A custom field from the contact or your import, such as {{custom.branch}}. Keys are snake_case: lowercase letters, digits and _, up to 32 characters. |
Add a fallback after a bar for contacts with no value: {{first_name|there}} reads “there” when the first name is empty. A fallback can be up to 60 characters. A variable with no value and no fallback is left out of the sent message, and the double space it would leave is closed up, so Hi {{first_name}}, … never reads Hi , …. The preview marks such a variable as ‹custom.branch› and says it has no value and no fallback, so you can add one before you save.
Create a template
Section titled “Create a template”-
Open Templates in the sidebar under Audience.
Open Templates. -
Click New template.
Click New template. -
Enter a Name, then write the Message. Click a chip under it, such as
{{first_name}}, to insert a variable at the cursor. For a custom field, type its key into Custom field and click Insert. End promotional messages with how to opt out, such as “Reply STOP to opt out”.Name it, write the message and insert variables. -
Check Preview for a sample contact. It counts the message as the phone will send it: the encoding (GSM-7, or UCS-2 for Arabic and emoji), the characters and the number of segments. Mistyped variables are listed in red above it and must be fixed before you can save.
Check the preview and segment count. -
Click Create template.
Click Create template.
Edit or delete a template
Section titled “Edit or delete a template”-
Click a template in the list to open it.
Click a template. -
Change the text and click Save template. Campaigns that already started keep the text they started with.
Edit the message and click Save template.
To remove a template, open it, click Delete and type the confirmation word. Draft campaigns that used it keep their own copy of the text.
Permissions
Section titled “Permissions”| To | You need |
|---|---|
| See templates | campaigns:read (Owner, Admin, Developer, Campaign manager, Viewer) |
| Create, edit and delete templates | campaigns:manage (Owner, Admin, Developer, Campaign manager) |
The API equivalent is in the templates reference. To send a template to an audience, see Campaigns.