Objective
This article shows you how to personalize a content template with variables, so a single template can insert a customer name, order number, or link at send time, and how to supply the sample values WhatsApp requires for approval.
Product
Content Template Builder
Environment
Twilio Console
User Account Permission/Role(s) Required
Your user needs the content templates create permission for the account to edit template content.
Procedure
- In the Twilio Console, select Communications in the left sidebar.
- Select Messaging, then Templates.
- Open the template you want to personalize, or start a new one.
- On the Details tab, place your cursor in the field where the personalized value should go, for example Body.
- Select Add variable beneath that field. A numbered placeholder is inserted at the cursor position, in the form
{{1}}. - Repeat step 5 for every value you want to personalize, in any supported field.
- Select Save.
- In the Sample variables panel, enter a sample value for each variable under Sample for: {{1}}, and so on. The panel shows the original field value and the value with your samples applied so you can check the result.
- Select Save to finish.
Additional Information
- Variables must be written as
{{variableName}}. A malformed placeholder or one containing white space fails validation. - Sample values are required for every variable in the panel.
- Some fields limit how many variables they accept. A website address, for example, accepts at most one variable, and it cannot sit inside the host name.
- A few fields do not support variables at all, the card Subtitle is one, and on a call to action button the Button text only accepts variables when the action type is Voice call.
- WhatsApp requires a sample for each variable in order to approve a template. If you skip the samples now, you will not be able to submit the template for WhatsApp approval later.
- The Sample variables panel only appears if the template actually contains variables, and it collects samples for the richest content type in the template.
This content was generated by AI and reviewed, edited, and verified by a human.