Setting up Twilio
Create a Twilio Account
- Go to Twilio and create an account, starting with their free trial.
- You’ll be asked to verify your email and your phone number. Get them verified.
Get a Twilio Phone Number
- Once verified, you’ll get an option to ‘get a Twilio phone number’ from your Twilio console.
- Click on it to get your Twilio phone number.
When first using Twilio there should be an option to get a Twilio phone number in the main
console. Otherwise, you may have to
Buy
a number to begin using it. For first-time users, utilize the free number provided.
Understand the Key Components
Irrespective of the language you use, the process requires:
- Account SID and Auth token loaded into the code using secure environment variables
- A Twilio client object that takes the SID and Token as variables
- A message object containing:
- Your Twilio phone number
- The recipient’s phone number
- The SMS message body
Creating a Twilio integration with Novu
Connect Twilio to Novu
- Visit the Integrations Store on Novu
- Click the “Add a provider” button
- Locate Twilio and click on the
Disabledbutton and mark it asActive - Click on the Connect button
Configure Twilio Credentials
- Go to your Console on Twilio and access the Account Info section
- Enter your:
Account SIDAuth TokenTwilio Phone Number
- Click on the Save button
Sending WhatsApp message
To send WhatsApp messages with Twilio integration, prefix the phone number of the subscriber withwhatsapp: as shown below:
- Node.js
Sending WhatsApp template message
To send WhatsApp template messages with Twilio integration, you can use thetemplate field in the overrides object.
- Node.js
Read more about sending a Message with the Twilio API for
WhatsApp.