Home  >   Articles   >  WhatsApp Integration with Twilio
Articles in this section

WhatsApp Integration with Twilio

B
Bindu Rekha Babu
28 Aug, 2023 - Updated 1 year ago
Table of Contents

Introduction

Twilio is a customer engagement platform used by thousands of businesses and more than ten million developers worldwide to build unique, personalized experiences for their customers.

It is known for democratizing voice, text, chat, video, and email channels through APIs. Twilio makes it easy for organizations to build meaningful customer interactions on the channels they prefer.

WhatsApp + Twilio + Vtiger Integration 

WhatsApp and Twilio integration on Vtiger CRM is available for the following modules:

  • Cases
  • Leads
  • Organizations
  • Contacts
  • Deals
  • Internal Tickets
  • Invoices
  • Quotes
  • Vendors

Note:

  • For Contacts and Vendors modules: Send messages directly to the phone number of the contact or vendor.
  • For other CRM modules: Send messages to the phone number of the related contact listed in the CRM.


To integrate WhatsApp with Twilio and use it with Vtiger CRM:

  • You need to have a Facebook Business Manager account. 
  • You must have a Business Manager ID.

Click here to create Facebook Business Manager ID.

Feature Availability

Click here for the availability of WhatsApp Integration features for different editions of Vtiger CRM. 

Integrating WhatsApp and Twilio with Vtiger CRM

You must have a Twilio as well as a business manager account with a WhatsApp account to integrate WhatsApp with Vtiger CRM. And then, you need to connect the two.

To integrate and use WhatsApp and Twilio with Vtiger CRM, you need to:

  • Step 1: Enable your WhatsApp account with Twilio
  • Step 2:  Configuring WhatsApp on Twilio
  • Step 3: Installing WhatsApp 
  • Step 4: Configuring WhatsApp in Vtiger CRM

Step 1: Enable your WhatsApp account with Twilio

Follow these steps to connect WhatsApp with Twilio:

 
  1. Log into your Twilio account. If you do not have a Twilio account, create it from here.
  2. Enable your WhatsApp account on Twilio. Learn about the details here.
  3. Submit your Twilio number(s) to WhatsApp for approval. 
    1. All customers who wish to create their profiles require approval from WhatsApp.
    2. Twilio numbers that you submit also need approval from WhatsApp and the approval process may take a little time. 
 
  1. To enable the integration in Vtiger, you will need the following information from Twilio: 
    1. Account SID
    2. Token
    3. WhatsApp From Number
  2. Copy the above information to a notepad.

Note: We can get the From number from Sandbox configuration under Sandbox participants.

Step 2: Configuring WhatsApp on Twilio

After you have bought and set up your Twilio account, you need to configure WhatsApp on the Twilio Console.
To send and receive WhatsApp messages from the registered Twilio number, you also need a Vtiger instance URL in Twilio. Let us see how.

Follow these steps to configure WhatsApp from your Twilio console:
 
 
  1. Go to the Twilio homepage.
  2. Log in using your User ID and Password.
  1. Click Messaging.
  2. Click Settings.
 
  1. Click  WhatsApp sandbox settings.
  2. Select Sandbox Configuration.
  3. Add the Vtiger instance URL in Twilio. This helps you to send and receive messages from Vtiger CRM.
  4. Enter the following details:
    1. WHEN A MESSAGE COMES IN - Enter the URL.
    2. STATUS CALLBACK URL - Enter the URL.
  1. Click Save.
 

Note:

  • Look up the link on the WhatsApp settings page. Copy the URL from the WhatsApp settings page in the CRM and paste it into the Twilio Configuration.
  • If this link is not copied from settings and added, you will not receive messages from your contacts.


Step 3: Installing WhatsApp

You have added the Vtiger instance on Twilio. Next, let us connect all three in Vtiger  CRM. Start by installing WhatsApp from the Extension Store. 

Note: You need to install WhatsApp since it is unavailable by default.
Follow these steps to install WhatsApp:

 
 
  1. Click  User Profile on the top right corner of the screen.
  2. Click Settings.
 
  1. Go to the  Extensions Store.
  1. Click WhatsApp.

After the installation of WhatsApp from the extension store, two modules are activated, WhatsApp and WhatsApp Templates.

The  WhatsApp icon is visible in:

  • The List View of every record in these modules - Contacts, Vendor, Deals, Invoices, Quotes, Cases, Internal Tickets, Leads, and Organization.
  • The Summary View under More (⋮) > WhatsApp

Step 4: Configuring WhatsApp in Vtiger CRM

Once you have installed WhatsApp, you need to configure the details and add Twilio as a service provider for WhatsApp in the CRM.

Follow the steps below to configure the details:

 
  1. Go to the Main menu.

  2. Click  Essentials.
  3. Click Conversations.  
  4. Click WhatsApp. The List View displays all available records for WhatsApp messages.
 
  1. Click Settings in the top right corner.
 
  1. Click + Add.
 
  1. Enter information for the following in the Add Config window:
    1. Provider (Service provider) - Select Twilio from the drop-down.
    2. Active/Inactive the Provider - Select Active Provider.
    3. Account ID - You will find it under the Twilio console after signup
    4. Token -  You will find it under the Twilio console after signup
    5. WhatsApp from Number - You can find From number on the Sandbox Configuration page. 

Note: From the WhatsApp > Add Config window:

  • You can add service providers like GupShup, Clickatell, and Textlocal. Start by installing them from the Extension Store. You can also edit the configuration of an existing service provider.

Using WhatsApp

Now that you have signed up for WhatsApp with your Twilio number, let us see what messages you can send your customers. 
Currently, you can:

  • Type and send individual text messages. (Only after receiving the messages from the customer.)
  • Send textual and image content. You need to get approval from WhatsApp before using media templates.
  • Use standard message templates, approved by WhatsApp to communicate with your customers. In some cases, you can create standard message templates. You can use these templates for different customers and avoid typing individual messages.
  • Once the customer replies to the sent message within 24hrs, you can reply with messages of your own.

Some examples of WhatsApp messages are:

  1. Do you have a new product line you want to talk about? Send a teaser using a WhatsApp message to your customers.
  2. Want to send a quotation to a customer? Send them a notification and attach the quote as a PDF along with a message.
  3. Is it that time of the year again? Send Season's Greetings and New Year Wishes to all your customers.

Note: Standard message templates from Twilio need to be approved by WhatsApp. 

Creating and Setting up Message Templates

Tired of typing and sending standard messages like season's greetings over and over again? You can avoid this hassle by creating standard message templates for your WhatsApp messages.

For example, your company has developed a new product line of paints that reflect changing seasons, and you want to share it with your customers. What if your customer list is enormous, and they want to see the catalog? Well, not to worry, you can use Vtiger CRM's WhatsApp Integration module to send your message.

Just create a standard message that will include a salutation, add the message, and attach the relevant catalog along with your message. Voila, you will send your contacts the new catalog in a jiffy.

Creating and setting up standard message templates is a two-step process.

  • First, create a standard message template on your Twilio console and get it approved by WhatsApp to use from your CRM.
  • Secondly, use standard approved templates when to have to send the message within 24 hrs.
 

Step 1: Setting up a standard message on the Twilio Console.

Follow these steps to add standard message templates on the Twilio console and get them approved from WhatsApp:

  1. Log in to the Twilio website using your Twilio credentials.
 
  1. Click Messaging.
  2. Click Senders.
 
 
  1. Click WhatsApp Templates.
  2. Go to the WhatsApp Message Templates section on the right-hand side.
  3. Click New Message Template.
 
 
 
  1. A Submit a New Message Template section will appear. Add the following details: 
    1. General Information Section: 
      1. Template Name: Enter the name of the template. .
      2. Template Category: Choose the template category from the drop-down.
    2. Message Template: 
      1. Choose the message language from the drop-down. 
      2. Type the message in the message body section. 
      3. Choose the buttons you wish to have below your message, like Call to Action and Quick to Reply.
8. Click Submit Message Template.
 
 
  1. The WhatsApp Message Templates section displays approved templates.

            You will see the following on the screen:

  1. Template Name:
  2. Message Text:
  3. The Message Template Status column will display WhatsApp approved and rejected template.
  1. Copy the approved message you created and paste it into the WhatsApp template record in the CRM.

Step 2: Creating a WhatsApp template in the CRM (for the approved message).

Note: Copy the approved message from the Twilio console and keep it ready.

Follow these steps to create standard message templates:

  1. Go to the Main menu.
  2. Go to Tools.
  3. Click  WhatsApp Templates.
  1. Click + Add Template.
  1.  Enter the following details in the Create WhatsApp Template window - 
    1. Header: Enter the header 
    2. Select the Media Type option and enter the Media URL
    3. Content: Add your message in this textbox. The message textbox on the left displays standard messages along with numbers in brackets. Replace these numbers with merge fields.
    4. Footer:
    5. Select the required Buttons 
    6. Template Name - Enter the name of the template.
    7. Assigned To - Select the employee to whom the template is assigned.
    8. Module - The module to the template is attached. For example, you can create templates for Invoices or for Deals, and so on.
    9. Merge Fields - Select and add standard merge fields. For example, you can choose salutation, phone numbers, primary email addresses, etc., and they will appear in the message textbox

The new template will appear in the WhatsApp Templates List View.

Note: 

  1. You can create our own template for all the modules.
  2. Remember, WhatsApp needs to approve all standard message templates you create before you can use them.  

Messaging with WhatsApp

Now that you have installed WhatsApp, and created standard templates, let us see how you can send and receive messages using the CRM. 

The WhatsApp icon appears on the screen in:

  • The ListView of every record in these modules - Contacts, Organization, Leads, Vendor, Deals, Invoices, Quotes, Cases, and Internal Tickets
  • The Summary View under More (⋮) > Reach out now > WhatsApp

You can send WhatsApp messages from:

  • The ListView (of different modules)
  • The Summary View
  • Related WhatsApp Tab in the Summary View
You can support related module fields in the WhatsApp template. The Related field is visible only when the selected module has at least one relationship field. 
For example, If you select the Contact module, the Account Name, and Relation fields like Website, Phone, Employees, Revenue, and other fields will be available
 
For the Deals module, you can select the Contact or Organization module field.

 

Sending a WhatsApp Message from the List View (of different modules)

Follow these steps to send a WhatsApp message from your CRM.

 
  1. Go to the ListView of a module.
  2. Hover on the record you want to send a WhatsApp message to.
  3. Click on the WhatsApp icon that is visible on the extreme right of the screen.
 
  1. Enter or select the following in the Send WhatsApp Message window:
    1. Select WhatsApp Template - Select WhatsApp templates to send messages.
    2. Phone Number - Select a phone number to send the WhatsApp message
      1. Note - The number must be a mobile number registered with the service provider installed to receive and send messages.
    3. Message window - Type your message in this textbox. Don’t forget the following.
    4. Emoji - Make your message fun.  Include emojis in your message by clicking the Emoji icon on the top right corner of the textbox.
    5. Attach files - Upload documents with your message by clicking the Attach Files link. You can attach only one document of size 16MB. 
  2. Click Send.

Note: Approved templates can be used only to send messages outside 24-hour sessions. This means when the customer has not replied within 24hrs, then we can use these approved template messages.

Sending A WhatsApp Message From the Summary View of a record.

 
  1. Click on a record to go to its Summary View.
 
  1. Click More
  2. Under the Reach out now option.
  3. Click WhatsApp.
 
 
  1. Enter or select the following in the Send WhatsApp Message window:
    1. Phone Number - Select a phone number to send the WhatsApp message                           Note: The number has to be a mobile number installed with WhatsApp to receive and send messages.
    2. Select WhatsApp Template - Select a message template if you want to send a standard message. This is optional.
    3. Message window - Type your message in the textbox.
i. Make your message fun: You can include emojis in your message by clicking the emoji icon in the top right corner of the textbox.
ii. Don't forget a document: You can upload documents along with your message by clicking the Attach Files link. You can attach only one document of a maximum size of 16 MB. 
           6. Click Send.
 

Sending a WhatsApp Message from the Related WhatsApp Tab in the Summary View

Follow these steps to send a WhatsApp message from your CRM.
  1. Click on a record to go to its Summary View.
  1. Select the WhatsApp icon on the Related Tab.
  2. The Chat/Message conversation box appears.
  3. You can Type a message in the message section. 
  4. You can use the message templates by clicking on the icon as shown in the screenshot. 
 

Note

  1. You cannot edit message templates in this window.
  2. You can attach only one file (or document) per message.  
 

Checking the Message Delivery Status of Whatsapp messages

Once you have sent a message on Whatsapp, you can check its status by heading to the Information section. 

Here, you can view the API Response and Failed Reason. If your message wasn't successfully delivered, the API Response field will display authentication failed. he Failed Reason field will give you more information on why the message was not sent.


 

Sending a Print Template with your Message 

Consider the following case: Have you ever booked a ticket on a travel or ticketing portal? On booking a ticket, you will have received a confirmation message on your WhatsApp number along with a PDF form of a ticket.

Similarly, you can send a document, perhaps an invoice to your customer, with your WhatsApp message.

  • To do so, select the Print Template option while sending a WhatsApp message.
  • On selecting this option, the CRM generates a PDF document in the Print Template. 
  • To learn more about Print Templates, click here

Note: The Print Template option is enabled only for the following modules - Deals, Quotes, Invoices, Cases, and Internal Tickets.

Message Formatting Options

Apart from sending plain text messages, you can also format the content in your WhatsApp messages. Below are the text formatting options available on WhatsApp:

  1. For Bold: Use Asterisk (*). For example, your total is *$10.50* > $10.50
  2. For Italics: Use Underscore (_). For example, Welcome to _WhatsApp_! > Welcome to WhatsApp!
  3. For Strike-through: Use Tilde (~). For example, This is ~better~ the best! > This is better than the best!
  4. For Code or Pre-formatted text: Use three backticks (```). For example, ```print "Hello World";``` > Hello World.

List View of WhatsApp Module
 

The List View of the WhatsApp module displays the list of all WhatsApp messages that have been sent and received. From the ListView, you can:

  1. Check sent and received messages.
  2. Check the status of messages.
  3. Open individual messages to view details.

The Activity section of individual records displays the details for each record.


Status of WhatsApp Messages

WhatsApp messages is visible in the following statuses in the ListView: 

  1. Sent
  2. Received
  3. Delivered
  4. Read
  5. Queued
  6. Undelivered

WhatsApp Messages from Workflows

You can now create workflows in the CRM for certain WhatsApp messages.

For example, you have sent your maintenance team to service ACs for your customers. The maintenance crew alerts you once a service is completed. You can create a standard template and set up a workflow to send the invoice to customers once a service is completed.

To set up a workflow for a WhatsApp message:

To know more about Workflows, click here

  • Go to Settings > Automation > Workflows > (Standard or Multipath) Actions 
  • Click Add Action drop-down and select WhatsApp

WhatsApp Messages for Approvals

You can also create WhatsApp messages and send approval notifications required for certain processes in the CRM. Approval notifications tell the receiver whether a request submitted was approved or rejected.

For example, if one of your salespersons submitted a Quote with a considerable discount for approval, as a Manager, you can send a WhatsApp message saying the discount was rejected. 

To know more about Approvals, click here.

Limitations 

  • You can type a message to a customer if he has sent you a WhatsApp message in the last 24 hours.
  • You can send approved WhatsApp messages outside of 24 hours.
  • You cannot send a media file greater than 16MB.
  • Currently, you can send only one media file at a time.
  • Supported media formats are:
    • Images  - JPG, JPEG, PNG
    • Audio - MP3, OGG, AMR
    • Documents - PDF
    • Video - MP4 (with H.264 video codec and AAC audio)
Was this article helpful?
0  out of  1  found this helpful.
Comments 0
Be the first to comment
© Copyright 2023 Vtiger. All rights reserved.