Skip to content
Meta Business PartnerGlossary term

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.

{{1}}, {{2}}, {{3}} — numbers in double curly braces
Syntax
Sequential, starting at {{1}}, no gaps
Numbering
At send time via the API components/parameters
Filled
Body, header, and dynamic buttons
Locations
Fixed text is reviewed once; values change freely
Approval

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

See InfiQ pricing

Talk to InfiQ

See how this works on InfiQ

Tell us your use-case — we’ll show it running in a sandbox, usually within a working day.

Step 1 of 2
WhatsApp

Protected by invisible spam checks · replies within 1 working day

Frequently asked questions

How do I write a message template variable?+
Wrap a number in double curly braces and place it wherever the text should change per recipient — for example "Hi {{1}}, your order {{2}} is confirmed." Number them sequentially from {{1}}, then supply a value for each one when you send.
How many variables can a WhatsApp template have?+
The body can contain multiple text variables, the header can hold one variable (text or media), and each supported button (like a URL or copy-code button) can take one. There's no single fixed cap on body variables, but Meta expects enough fixed text around them that the template's purpose is clear, or it may reject the template.
What happens if I pass the wrong number of values?+
The send fails validation. WhatsApp expects the number of parameters you pass to exactly match the number of placeholders in the template. Passing too few or too many values, or leaving one blank, results in an error rather than a partially-filled message.
Are message template variables the same as merge tags in email?+
Conceptually yes — both inject per-recipient data into a reusable message. The difference is that WhatsApp variables are strictly positional numbers ({{1}}, {{2}}) mapped by order in the API call, and the surrounding template must be pre-approved by Meta, whereas email merge tags are usually named and unreviewed.
Do variables affect how much a message costs?+
Not directly by count. Since 1 July 2025 WhatsApp bills per delivered message by category — marketing, utility, or authentication —. What matters for cost is the template's category and that it delivers cleanly; a broken variable causing failed sends or resends is where variables can indirectly cost you.
Why does Meta ask for sample values when I create a template?+
Sample values show the reviewer the kind of real data each variable will hold, so they can judge the template's intent and category. Realistic, honest samples speed up approval; vague or misleading ones are a very common reason templates get rejected.
Can I change a variable value without re-approval?+
Yes — that's the whole point of variables. You can pass different values on every send without any re-approval. Only changing the fixed, approved text or structure of the template requires re-submitting it to Meta.
Can a variable go inside a button or header?+
Yes. A header can carry one variable (text or a media placeholder), a URL button can end in a variable to personalise the link, and a copy-code button carries the actual code. Each component has its own validation, so build and test them separately.

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.