Setup Twilio WhatsApp API
The secured communications over HTTPS from your application will enable private conversations with your users. Your WhatsApp branded business identity will serve as familiar face users see and help you increase brand loyalty.
WhatsApp has an average open rate of over 98%, making it most effective among all channels for sending crucial information like payment reminders/confirmation, order updates, etc.
Advantages of integrating WhatsApp API into your website –
- Connect with your customers globally
- Send messages across any mobile OS, device, and carrier.
- Know the instant a message reaches your users with read-recipients.
- Secure communication with end-to-end communication.
- Deepen customers’ trust in brand messaging.
With Twilio for WhatsApp, you can reach users on the world’s most popular messaging app through one streamlined API, officially supported by WhatsApp. With real-time delivery and reading receipts, get your critical message delivery insights.
Certain requirements are to be fulfilled for successful integration, they are:
- You must have a registered and verified WhatsApp Business Account Phone number. Also, this number should not be linked with another WhatsApp Business Account.
- To start your application, go to the dashboard and from the left-hand side panel, navigate to the Develop >> Messaging >> Try it out >> Send a WhatsApp message:

- Here, you’ll find a WhatsApp number where you’ll be instructed to send a message.
- Save the message on your phone and send the message.
- This number is the Sender ID (until your application is in Sandbox Mode), so please save it for future references.
To integrate Twilio and use its services, you need to integrate the OnPrintShop store using Account SID and Auth Token. To get the credentials, navigate to the Dashboard >> Admin >> Account Management:

- Now, click on the API Keys & tokens from the left navigation panel. This will take you to the "Auth tokens & API keys" page. Scroll down to the Auth Tokens section:

- Here, you will get your Account SID and Auth Token along with the Test Credentials.
- Copy and keep the Account SID and Auth Token somewhere safe and secure.
Note: Content templates in Twilio can only be created for the templates available in the SMS Notifications section of the OnPrintShop Admin Panel.
In the Twilio Console, navigate to the Develop >> Messaging >> Content Template Builder:

Click on the "Create your first content template" or "Create new". It will redirect you to the next page to enter the template information:

- Enter the template name as per the instructions.
- Select "English" in the Template Language.
- From the Content Type, select "Text" type.
- Click on the Create button.
- On the next screen, the system will ask you to define the body content of the template:

While defining the message content, you can see the real-time preview in the mobile view.
After body text, as soon as you click on the Save and submit for WhatsApp approval button, a popup will appear for you to define some samples for the variables used in the message text:

You can choose to save the template with or without the samples.
Note: Only the variables listed in the respective SMS Notifications template (OnPrintShop Admin Panel) can be used in the message.
Once the content is saved, it will be sent to Meta Meta (Facebook) for approval and it will be listed in the main screen:

- In the Admin Panel, go to the Store Configuration >> External Service Setting >> SMS Notification Tab >> Twilio WhatsApp >> Enable the toggle:

- Under the Edit, enter the Account SID, Auth Token, and the Sender ID saved in Step-1 and Step- 2.
- Select and assign the countries from the list.
- In the Mode field, select the mode from the drop-down as Live.
- Enter the email ID save the details.
After the configuration, click on the go to the Map SMS Templates from the SMS Templates Mapping section:

First of all, click on the Sync Templates button from the top right corner of the screen. This will fetch and list down all the content templates you have created in the Twilio dashboard in the Twilio WhatsApp Template dropdown.
Now, it is time to map the messages from twilio with the admin panel using Map Templates:

- Select the store, email template and the content templates from the drop down.
- Click on Save and Back.
Once you save the configuration details, your customers will be able to see a message under their My Profile and Registration Page asking their consent to opt for WhatsApp notifications:

Also, while adding any customer from the Admin Panel, you’ll get the option to enable the WhatsApp notifications for the customer:

To get your Sender ID, you would require to connect with the Twilio Team and make your application live.