Overview
Variables allow you to personalise WhatsApp Template Messages by replacing placeholders with recipient-specific information when a message is sent. Instead of creating a separate template for every customer, you can use variables to insert names, order numbers, appointment dates, tracking IDs, and other dynamic values.
SPRL supports template variables for both WhatsApp campaigns and REST API messaging, making it easy to send personalised messages at scale.
Good to Know:
Variables are replaced with actual values when the message is sent. Each recipient can receive the same template with different personalised information.
Why Use Variables?
| Without Variables | With Variables |
| Create multiple templates for different recipients. | Use one template for all recipients. |
| Manual editing before every campaign. | Values are inserted automatically when sending. |
| Less efficient for bulk messaging. | Ideal for personalised bulk campaigns. |
Example Template
A template can contain one or more numbered variables.
| Template Content | Example Result |
| Hello {{1}}, your order {{2}} has been shipped. | Hello Suraj, your order ORD-10254 has been shipped. |
| Your appointment is scheduled for {{1}}. | Your appointment is scheduled for 24 July 2026. |
Using Variables in Campaigns
- Navigate to Dashboard → WhatsApp → Campaigns.
- Create a new campaign.
- Select an approved template.
- Provide values for each required variable.
- Review the message preview.
- Send or schedule the campaign.
Using Variables with the REST API
If you are sending messages through the REST API, include the variable values in your API request according to the selected template.
The platform automatically replaces the variables before delivering the message.
Using Template Buttons
Templates can also include interactive buttons to improve customer engagement.
| Button Type | Purpose | Limit |
| Quick Reply | Allow recipients to respond with a predefined option. | Up to 10 buttons per template. |
| Visit Website | Open a specified website URL. | Maximum 2 URL buttons. |
| Call Phone | Allow recipients to call a specified phone number. | Maximum 1 phone button. |
| Copy Code | Allow recipients to copy a promotional or offer code. | Maximum 1 copy code button. |
Button Guidelines
| Requirement | Description |
| Total Buttons | Maximum of 10 buttons per template. |
| Button Label | Up to 25 characters. |
| Website Buttons | Support website links. |
| Phone Buttons | Support click-to-call actions. |
| Quick Replies | Allow customers to respond with predefined choices. |
Best Practices
- Use variables only where personalised information is required.
- Verify every variable value before sending a campaign.
- Keep variable placement natural within the message.
- Use descriptive button labels that clearly explain the action.
- Avoid creating unnecessary variables when static text is sufficient.
- Preview templates before sending large campaigns.
Troubleshooting
My variable isn't showing the expected value
Verify that a value has been provided for every required variable before sending the campaign or API request.
I cannot send the template
Ensure the template has been approved and all required variables have valid values.
I cannot add more buttons
Templates support a maximum of 10 buttons. Individual button types also have their own limits.
My button label is too long
Button labels can contain up to 25 characters. Shorten the text before saving the template.
Frequently Asked Questions
Can I use multiple variables in one template?
Yes. A template can include multiple variables wherever personalised information is required.
Can every recipient receive different variable values?
Yes. Variable values are supplied individually for each message when it is sent.
Can I use variables with the REST API?
Yes. Variable values can be provided through API requests as well as WhatsApp campaigns.
What button types are supported?
Templates support Quick Reply, Visit Website, Call Phone, and Copy Code buttons.
Learn More:
Continue with WhatsApp API Webhooks to learn how to receive message status updates and integrate WhatsApp events with your applications.
Tip: Reuse a single template with variables instead of creating multiple similar templates. This simplifies template management while allowing every recipient to receive a personalised message.