Skip to main content

Templates

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.

Why Templates?

Templates solve three key problems:
  1. WhatsApp Compliance: Meta requires businesses to use approved templates when initiating conversations outside the 24-hour window
  2. Consistency: Ensure your transactional messages follow a consistent format
  3. Multi-Channel Delivery: Define one template with channel-specific bodies, then send it on any channel

Template Structure

A template consists of:

Fields

Template Variables

Templates support dynamic content through variables. Two formats are supported:

Numbered Variables (WhatsApp Native)

Use {{1}}, {{2}}, {{3}} for WhatsApp compatibility:

Named Variables

Use {{name}} for better readability:
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.

Contact Variables

Use {{contact.*}} variables to auto-resolve values from the recipient’s contact metadata:
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.

WhatsApp Categories

WhatsApp requires every template to be categorized:
Marketing templates have stricter approval requirements and may have different pricing. Use UTILITY for transactional messages.

Authentication Templates

Authentication templates are used for sending verification codes (OTPs) to users. These templates have special requirements and behavior.

Requirements

Meta requires your WhatsApp Business Account to meet these criteria before you can create AUTHENTICATION templates:
  1. Business Verification: Your business must be verified by Meta
  2. Conversation History: At least 2,000 business-initiated conversations in the last 30 days
If your account doesn’t meet these requirements, AUTHENTICATION templates will fail with a permission error.

How Authentication Templates Work

Unlike regular templates, authentication templates have a pre-defined message format controlled by Meta. When you create an authentication template:
  • The message body is automatically generated by Meta
  • The format is: {{1}} is your verification code.
  • You cannot customize the body text

OTP Button Types

Authentication templates support two types of OTP buttons:

ONE_TAP Button Requirements

For ONE_TAP buttons (Android autofill), you must provide:

Optional Security Features

Authentication templates can include:

Creating an Authentication Template

The body field should be empty or omitted for authentication templates. Meta will automatically generate the message body.

WhatsApp Approval Workflow

WhatsApp templates must be approved by Meta before use:

Template Statuses

Creating Templates

Via API

Response

Rich Template Components

WhatsApp templates can include rich components: Add a header with text, image, video, or document:
Add a footer text:

Buttons

Add interactive buttons:

Sending Template Messages

To send a template message, specify the template ID and variables:

Templates with Dynamic URL Buttons

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.

Multi-Channel Templates

Templates support channel-specific bodies. When a message is sent, Zavu uses the channel-specific body if available, falling back to the default body.

Sending Templates on Different Channels

WhatsApp templates require Meta approval before use. Templates on SMS, Telegram, and Instagram do not require external approval.

Managing Templates

List Templates

Get Template

Delete Template

Best Practices

Keep It Short

WhatsApp has character limits. Keep your templates concise and actionable.

Use UTILITY Category

For transactional messages, always use UTILITY to improve approval chances.

Test Before Launch

Create templates early in development. Approval can take 24-48 hours.

Handle Rejections

If rejected, review Meta’s guidelines, fix the issue, and resubmit.

Common Rejection Reasons

Next Steps

WhatsApp Templates

Deep dive into WhatsApp template features

Senders

Learn how templates work with senders

API Reference

Manage templates programmatically: