Overview
WhatsApp templates use variables (placeholders) like{{1}}, {{2}}, etc. Variable mapping connects these placeholders to actual data from your calls.
Variable Sources
Choose where each template variable gets its data:
1. Call Metadata
Customer information from your system. Examples:customer_name- Customer’s namecustomer_email- Email addresscustomer_phone- Phone numberlead_id- CRM lead ID- Custom fields you defined
- Select from dropdown of available metadata fields
- Or choose “Other” to enter custom metadata key
2. In-Call Variables (In-Call Only)
Dynamic data extracted from the live conversation. Configuration:- Variable Name: What to extract (e.g.,
otp_code,booking_id) - Description: Tell AI what to look for
3. Post-Call Variables (Post-Call Only)
AI-extracted information after the call ends. Examples:appointment_date- Date customer selectedappointment_time- Time customer selectedinterested- Whether customer showed interestconfirmation- Whether customer confirmed- Custom post-call variables you defined
- Select from dropdown of configured post-call variables
4. Static Values
Fixed text that never changes. Examples:- Company name:
"ABC Company" - Support email:
"support@company.com" - Website:
"www.company.com"
Template Sections
WhatsApp templates have three sections where variables can appear:Header Variables
Variables in the template header (usually{{1}}).
Example Header:
{{1}}→ Call Metadata:customer_name
Body Variables
Variables in the main message body. Example Body:{{1}}→ Post-Call Variables:appointment_date{{2}}→ Post-Call Variables:appointment_time{{3}}→ Static Value:"123 Main St"
Button URL Variables
Variables in button click-to-action URLs. Example Button:{{1}}→ Post-Call Variables:booking_id
In-Call vs Post-Call Differences
| Feature | In-Call | Post-Call |
|---|---|---|
| Call Metadata | ✅ Available | ✅ Available |
| Dynamic Data | In-Call Variables | Post-Call Variables |
| Static Values | ✅ Available | ✅ Available |
| Data Source | Live conversation | Call analysis |
Mapping Examples
Example 1: OTP Message (In-Call)
Template:{{1}}→ Call Metadata:customer_name{{2}}→ In-Call Variables:- Name:
otp_code - Description: “6-digit verification code”
- Name:
Example 2: Appointment Confirmation (Post-Call)
Template:{{1}}→ Call Metadata:customer_name{{2}}→ Post-Call Variables:appointment_date{{3}}→ Post-Call Variables:appointment_time{{4}}→ Static Value:(555) 123-4567
Example 3: Payment Link (In-Call)
Template with Button:{{1}}→ Call Metadata:customer_name{{2}}→ In-Call Variables:- Name:
payment_amount - Description: “Total amount to pay”
- Name:
{{3}}→ In-Call Variables:- Name:
payment_id - Description: “Unique payment ID”
- Name:
Metadata Fields
System Metadata
Built-in fields automatically extracted from{{placeholders}} in your system prompt:
Example System Prompt:
customer_nameappointment_typecustomer_email
Custom Metadata
Add custom fields using “Other” option: Steps:- Select “Other…” in metadata dropdown
- Enter custom key name (e.g.,
lead_score) - This field will be available in your API calls
Best Practices
- Use metadata - For customer info that doesn’t change during calls
- In-call for real-time - OTPs, payment IDs, dynamically generated data
- Post-call for analysis - Appointment details, customer decisions
- Static for constants - Company info, support contacts
- Test before deploying - Send test messages to verify mappings
- Clear variable names - Use descriptive names for in-call variables