The Twilio WhatsApp Data Connector uses Twilio's Messaging API to send WhatsApp messages.
WhatsApp messages must be pre-configured in your Twilio Dashboard and must be sent from a phone number designated as a WhatsApp sender.
This Data Connector extends the functionality of the Twilio Data Connector.
Once this and the Twilio Data Connector have been installed and added to a Form, you can access this Data Connector in the Form's server event scripts using: connectors.verjio.twilio.
twilio.sendWhatsApp sends a WhatsApp message from one of your Twilio WhatsApp designated phone numbers.
twilio.content.createWhatsAppAuthenticationTemplate create a template to deliver one-time passwords with a copy code button.
twilio.content.createWhatsAppCardTemplate create a template that contains a header, a message, a footer and any number of action buttons.
Code Example:
// Create the content.
// Note that in practice, Content Templates need approval before it can be used for WhatsApp messaging.
// See twilio.content.submitContentForApproval in the Twilio Data Connector
// documentation for more information.
const content_sid = connectors.verjio.twilio.content.createTextTemplate(
'happy_birthday',
'Happy birthday {{1}}! Why not celebrate with some ice cream?',
{ 1: 'first_name' } );
// Send a WhatsApp message
connectors.verjio.twilio.sendWhatsApp(
connectors.verjio.twilio.helpers.formatPhoneNumber('+441234567890'),
content_sid,
{ 1: 'Fred' },
<your Messaging Service id> );
For comprehensive information on how to use and develop applications with this Data Connector please refer to the Support section.
The Installation section has instructions on installing it into your Workspace.
Complete JavaScript API documentation for this Data Connector can be found in the Documentation section.