Templates are reusable message formats for sending structured messages across WhatsApp, SMS, Telegram, Instagram, and Email. They are especially important for WhatsApp, which requires template approval for business-initiated conversations.
"Hi {{customer_name}}, your order {{order_id}} ships on {{date}}"
When you create a template in Zavu, named variables are automatically
converted to numbered format ({{1}}, {{2}}) at the moment it is submitted to
Meta. The template is therefore approved as positional at Meta, even though
Zavu keeps the readable named body for display.Templates imported from an existing WhatsApp Business Account keep whatever
format Meta has on file — these can be named ({{customer_name}}) or
positional ({{1}}). Zavu detects the format per template and sends the
correct payload either way.
Whichever format a template uses, you always pass values the same way through
templateVariables — keyed by name ({ "customer_name": "John" }) or by
position ({ "1": "John" }). Zavu maps them to the format Meta expects. See
Sending templates for
details.
Use {{contact.*}} variables to auto-resolve values from the recipient’s contact metadata:
Variable
Resolved From
{{contact.first_name}}
Contact metadata first_name
{{contact.last_name}}
Contact metadata last_name
{{contact.phone}}
Contact’s phone number
{{contact.email}}
Contact’s primary email
{{contact.country}}
Contact’s country code
{{contact.custom_field}}
Any custom metadata field
"Hola {{contact.first_name}}, tu pedido esta listo."
When the message is sent, Zavu looks up the recipient’s contact record and replaces these variables automatically. If the contact doesn’t exist or the field is empty, the variable is replaced with an empty string.
Contact variables work on all channels: SMS, Telegram, Instagram, and Email. You can also pass explicit values via templateVariables as a fallback.
If your template has a URL button with a {{1}} placeholder (e.g., https://example.com/orders/{{1}}), pass the value through templateButtonVariables. Keys are the button index (0-based) in the template’s buttons array.
WhatsApp URL buttons only accept {{1}} (positional, single digit, no whitespace, no name). Named or padded placeholders like {{token}} or {{ 1 }} are stored as literal text and cannot be substituted. See the WhatsApp templates guide for the full ruleset.
Templates support channel-specific bodies. When a message is sent, Zavu uses the channel-specific body if available, falling back to the default body.
{ "name": "order_confirmation", "body": "Hi {{1}}, your order {{2}} is confirmed!", "smsBody": "Order {{2}} confirmed for {{1}}. Track at example.com", "telegramBody": "Hi {{1}}, your order {{2}} is confirmed! Check your Telegram for updates.", "instagramBody": "Hi {{1}}! Order {{2}} confirmed.", "emailSubject": "Order {{2}} Confirmed", "emailHtmlBody": "<h2>Order Confirmed</h2><p>Hi {{1}}...</p>"}