Message Template Variable
A message template variable is a numbered placeholder — written as {{1}}, {{2}}, {{3}} and so on — that you drop into an approved WhatsApp message template and fill with dynamic data at the moment the message is sent. The template text ("Hi {{1}}, your order {{2}} ships today") is what Meta reviews and approves once; the variables are how a single approved template personalises to thousands of different recipients. Understanding how variables are numbered, mapped, and validated is one of the most practical skills for anyone running WhatsApp campaigns or notifications on the API in India.
In one line
A message template variable is a placeholder like {{1}} inside an approved WhatsApp template that gets replaced with real data — a name, order ID, OTP or date — each time the template is sent to a specific contact.What a message template variable actually is
When you create a WhatsApp message template, the fixed wording is reviewed and approved by Meta once. Anywhere the content needs to change per recipient, you insert a variable: a positive integer wrapped in double curly braces, such as {{1}} or {{2}}. These are strictly positional — they must be numbered sequentially starting at {{1}}, with no gaps and no duplicates in the way you'd expect. At send time your API call (or InfiQ's campaign builder) supplies a value for each variable, and WhatsApp substitutes them in order to render the final message the customer sees. The template is the reusable frame; the variables are the slots; the values you pass are the live data that make one approved template serve an entire customer base.
- Syntax is double curly braces around a number: {{1}}, {{2}}, {{3}}
- Variables are positional — order of the values you pass must match the numbers
- The same variable can appear in the body, header, or button URL of a template
- Approval covers the fixed text and structure, not the specific values you inject later
Where variables can appear in a template
Variables aren't limited to the message body. A well-built template can carry dynamic data in several components, each with its own rules. The body supports multiple text variables and is where most personalisation lives. The header can hold a single variable — either a text variable or a media placeholder for an image, document, or video that changes per send. Buttons can be dynamic too: a URL button can end in a variable so each recipient gets a personalised link (an order-tracking page, a payment link, a booking reference), and copy-code buttons carry the actual coupon or authentication code. Knowing which component a variable belongs to matters, because Meta applies different validation to headers, bodies, and button URLs.
- Body: multiple text variables for names, amounts, dates, references
- Header: one variable — text, or a media placeholder (image/document/video)
- URL button: a trailing variable to personalise the destination link
- Copy-code button: carries the OTP or coupon value for authentication and offer templates
How variables are filled at send time
At the moment of sending, your request maps each numbered placeholder to a value. In the WhatsApp Cloud API payload this is done through the components array, where you list parameters in order for the body, header, and any button that takes a variable. Pass values in the same sequence the numbers imply — the first parameter fills {{1}}, the second fills {{2}}, and so on. Get the order wrong and the message still sends, but the customer receives a name where an amount should be. On InfiQ, this mapping is handled for you: you upload a contact list or connect a data source, map spreadsheet columns or CRM fields to each variable, and the platform validates the mapping before the campaign goes out — so a missing value or a mismatched column is caught before a single rupee is spent.
Why message template variables matter for cost and compliance
Variables sit at the intersection of personalisation, deliverability, and spend. On the deliverability side, Meta rejects or pauses templates whose variables look manipulative — for example a body that is almost entirely placeholders with little fixed context, or a variable used to smuggle in content the reviewer never saw. On the cost side, every delivered template message is billed by its category (marketing, utility, or authentication), so a broken variable that causes a resend, or a wrongly-categorised template, directly affects what you pay. WhatsApp moved to per-delivered-message pricing by category on 1 July 2025; the 24-hour service window remains a free window for replying to customers, not a billing unit. Because InfiQ is an official Meta Business Partner, it applies transparent ₹ pricing (ex-GST), so you can see exactly what a personalised utility or marketing send costs before you launch it.
Common mistakes with template variables
Most variable problems trace back to a handful of avoidable errors. The classic one is a mismatch between how many variables the template defines and how many values you pass — WhatsApp expects an exact count. Another is empty or whitespace-only values: a blank {{1}} can cause the send to fail or produce an awkward message. Non-sequential numbering (jumping from {{1}} to {{3}}) will fail validation, as will putting newlines, tabs, or four or more consecutive spaces inside a variable value. Providing sample values during template creation is not optional busywork — Meta uses them to understand intent, and vague or misleading samples are a frequent cause of rejection. Finally, teams sometimes forget that changing the fixed text of an approved template requires re-submission and re-approval; only the variable values are meant to change freely between sends.
- Value count doesn't match the number of {{n}} placeholders defined
- Blank, whitespace-only, or overly long variable values
- Non-sequential numbering or a variable used with no surrounding fixed text
- Newlines, tabs, or 4+ consecutive spaces inside a value
- Weak or misleading sample values at creation, leading to template rejection
Frequently asked questions
How do I write a message template variable?+
How many variables can a WhatsApp template have?+
What happens if I pass the wrong number of values?+
Are message template variables the same as merge tags in email?+
Do variables affect how much a message costs?+
Why does Meta ask for sample values when I create a template?+
Can I change a variable value without re-approval?+
Can a variable go inside a button or header?+
Build personalised WhatsApp templates the right way
InfiQ maps your data to every template variable, validates it before launch, and sends with transparent ₹ pricing — book a demo to see it working with your own contact list.