Oops! Facing network problem. Unable to load this page. Refresh

Please Wait...

Hello Guest

logo

FAQs

Help
Center

WhatsApp Business API

Using Variables in Templates

Personalize WhatsApp messages using dynamic variables.

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

  1. Navigate to Dashboard → WhatsApp → Campaigns.
  2. Create a new campaign.
  3. Select an approved template.
  4. Provide values for each required variable.
  5. Review the message preview.
  6. 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.

Need more help?

Our support team is always happy to assist you.

×

We use cookies to improve your experience, analyse traffic, and personalise content. By clicking “Accept”, you consent to the use of cookies as described in our Cookie Policy .

Accept cookies Read our Cookie Policy