WhatsApp messages: Content Templates
UpdatedTwilio is deprecating Whatsapp Templates in favor of Content Templates. To send Whatsapp messages made with Content Templates, you must use webhooks in Customer.io. It’s on our roadmap to natively support Whatsapp messages made with content templates before Twilio deprecates Whatsapp Templates.
Prerequisites
Complete the WhatsApp approval process. You must have an approved WhatsApp Business Account to support WhatsApp. Twilio facilitates the approval process and provides instructions to enable WhatsApp messaging.
Send a WhatsApp message
Once WhatsApp support is enabled on your Twilio account, create webhooks in campaigns or broadcasts to send Whatsapp messages made with Content Templates.
- Go to the campaign or broadcast workflow that you want to send WhatsApp messages from.
- Add a webhook.
- In a campaign or API-triggered broadcast, drag the Send and receive data block onto the canvas. Click the block then click Add request.
- In a newsletter, click Webhook on the Content step.
- Keep the method as POST.
- Add your URL. It should follow this format:
https://api.twilio.com/2010-04-01/Accounts/ACCT_SID/Messages.json?ContentSid={{ "CONTENT_SID" | url_encode }}&ContentVariables={{ '{"1":"' | append: customer.name | append: '","2":"?' | append: event.reset_token | append: '"}' | url_encode }}&To={{ "whatsapp:" | append: customer.phone_number | url_encode }}&From={{ "whatsapp:+FROM_NUMBER" | url_encode }}
- Be sure to replace the following fields with your data:
- ACCT_SID
- CONTENT_SID
- FROM_NUMBER
- Be sure to replace the following fields with your data:
- Add these headers with your data:
- Content-Type:
application/x-www-form-urlencoded
- Authorization:
Basic {{"ACCOUNT_SID:AUTH_TOKEN" | base64_encode }}
- Content-Type:
- Save your changes then click Done to return to your workflow.
- In a campaign or API-triggered broadcast, click your webhook action, then change the sending behavior from Queue Draft to Send Automatically.
Customer.io does not know which sender identities or messages templates are WhatsApp approved!
If you try to send to someone or enter a message that is not WhatsApp approved, your messages will fail to send.
If you have different senders for SMS and WhatsApp messages, you may want to note which of your senders are for SMS and which are for WhatsApp messages in Twilio before syncing your phone numbers again.