Twilio has created an API to integrate applications with WhatsApp. So you can send WhatsApp messages for marketing campaigns (for example) through another application. We have integrated this into coreBOS.

It works both ways. First, you send the WhatsApp message, then a Message record is created in the application and when the message is opened and read, Twilio sends a push notification marking the Open field in the Message record of coreBOS.

The first thing you should do is create a Twilio account. It is free at the beginning and you have a sandbox where you can test the integration before going live. Twilio will provide you with a number from which you can start testing the API. You have to register also some numbers you want to send the test message to.

Get the Sid, token and from number from Twilio

and put it in coreBOS in the Utilities extension (index.php?module=Utilities&action=integration)

We have created a Workflow Task type for WhatsApp messages. So we are going to create a new Workflow. For example, we want to send a message while saving a Contact that fulfills some conditions. We choose the phone fields of the module to which we are sending the message and we write the message body. We can also attach one or more files to the message. In this case, we are sending two or more messages. One with a message and another with attachments. You can send only attachments of a maximum size of 5MB. We are also creating multiple message records in coreBOS. One for the text message and another for the attachments.

After these steps, we can make a test and see the message arriving in WhatsApp and the records created in the CRM.

On the other hand, to get the message status, we have to register a Callback URL in Twilio.

There is a file in coreBOS that gets the Twilio push notifications and updates the Open field in the Message with +1 each time a message is opened and read.

If we want to go live, we should upgrade the Twilio account, register one or more phone numbers as from numbers, and wait for Twilio to confirm them.

Next | Chapter 12: WordPress Woocommerce Integration