Magento 2 WhatsApp Notifications

 

Magento 2 WhatsApp Notifications sends WhatsApp notifications to customers, updating them about their store activities such as: order placement, invoice, order cancellation, shipment, etc.

 

Table of Content

  1. Extension Installation Guide
  2. Twilio Registration
  3. Configuration
  4. Creating Twilio Message Templates
  5. Order Placement Notification Settings
  6. Order Invoice Notification Settings
  7. Order Cancellation Notification Settings
  8. Order Shipment Notification Settings
  9. Credit Memo Notification Settings
  10. Contact Inquiry Notification Settings
  11. New Customer Registration Notification Settings
  12. WhatsApp Notifications in Frontend

 

  1. Extension Installation
  • Extract the zip folder and upload our extension to the root of your Magento 2 directory via FTP.
  • Login to your SSH and run below commands step by step:
    • composer require twilio/sdk
    • php bin/magento setup:upgrade
    • For Magento version 2.0.x to 2.1.x - php bin/magento setup:static-content:deploy
    • For Magento version 2.2.x & above - php bin/magento setup:static-content:deploy -f
    • php bin/magento cache:flush
  • That’s it.

Note: Don’t forget to install the Twilio library else our extension will not work.

 

  1. Twilio Registration
    To use Twilio as a gateway to send WhatsApp notifications, you need to register with the Twilio to get Account SID, Auth Token and Twilio Phone Number.
  • First of all, Sign Up for the Twilio account. Add the details and click to get started.


 

  • After the Email verification, enter your mobile number and click to “Verify”.



 

  • Once you click “Verify”, you will get an OTP on the added mobile number. Enter the OTP and verify the mobile number. Now move to Settings > General where you can see API details both for live and testing. Copy the Account SID and Auth Token to use them in Magento 2 backend configuration for Twilio account.



 

  • Now, click three dots from the left sidebar, go to Programmable SMS and click Build under the Learn and Build option. From here, you can get Twilio phone number to use for sending the SMSs. Click on the “Get a number” button.



 

  • You will get a number to choose. Click “Choose This Number”.



 

  • Once you click the button, you will get a Twilio phone number. Copy this number and set it in the Magento 2 backend configuration for Twilio account. 


 

  1. Configuration
    To configure the extension, log in to Magento backend, move to Stores > Configuration > WhatsApp Notifications where you can find various settings to configure the extension.
  • WhatsApp Notifications: Enable or disable the WhatsApp Notifications extension.
  • Admin Mobile Number: Enter the mobile number of admin to receive the WhatsApp Notifications.

  1. API Settings
    The extension provides integration with the Twilio 3rd party API. Register with Twilio, buy WhatsApp message credits, get API details to configure the API settings.
  • API Provider: Select the API provider, here Twilio.
  • Twilio SID: Enter Twilio SID received while registration with Twilio.
  • Twilio Token: Enter Twilio token received while registration with Twilio.
  • Twilio Number: Enter Twilio number received while registration with Twilio.


 

  1. Creating Twilio Message Templates
    Once you configure the extension, login to your Twilio account, go to https://www.twilio.com/console/sms/whatsapp/senders/, click on your WhatsApp number.

 

Under the “Message Templates” option, click + sign to add new message templates. Make use of variables to add the message text same as Magento backend. Follow this guide to write the message template in a proper format.

 

  1. Order Placement Notification Settings
    The module allows sending WhatsApp notifications to both the admin and customers when they place the order. To configure its settings, follow these steps as shown below:
  • Order Placement Notification: Enable order placement notification to customers.
  • WhatsApp Notification Text for Customers: Enter the order placement notification text to send to customers.
  • Order Placement Notification to Admin: Enable order placement notification to admin.
  • WhatsApp Notification Text for Admin: Enter order placement notification text to send to the admin.

  

  1. Order Invoice Notification Settings
    You can send WhatsApp notification to customers as well as admin to let them know that the Order Invoice is generated once the following settings are configured:
  • Order Invoice Notification: Enable order invoice notification to customers.
  • WhatsApp Notification Text for Customers: Enter the order invoice notification text to send to customers.
  • Order Invoice Notification to Admin: Enable order invoice notification to admin.
  • WhatsApp Notification Text for Admin: Enter order invoice notification text to send to the admin.

  

  1. Order Cancellation Notification Settings
    To let customers know that their order has been canceled successfully, a WhatsApp Notifications is sent. Additionally, admin is also notified of a cancelled order. Follow these steps for the same:
  • Order Cancellation Notification: Enable order cancellation notification to customers.
  • WhatsApp Notification Text for Customers: Enter the order cancellation notification text to send to customers.
  • Order Cancellation Notification to Admin: Enable order cancellation notification to admin.
  • WhatsApp Notification Text for Admin: Enter order cancellation notification text to send to the admin.

  

  1. Order Shipment Notification Settings
    Customers get notifications when their shipment is off for delivery. Admin is also notified for the same. This feature will be enabled when the following settings are configured:
  • Order Shipment Notification: Enable order shipment notification to customers.
  • WhatsApp Notification Text for Customers: Enter the order shipment notification text to send to customers.
  • Order Shipment Notification to Admin: Enable order shipment notification to admin.
  • WhatsApp Notification Text for Admin: Enter order shipment notification text to send to the admin.



 

  1. Credit Memo Notification Settings
    To confirm with customers that their refund request has been accepted, a WhatsApp notification will be sent to customers. Similarly, the admin will be sent a WhatsApp Notification when a credit memo is generated. Configure the following settings to enable this feature.
  • Order Credit Memo Notification: Enable order credit memo notification to customers.
  • WhatsApp Notification Text for Customers: Enter the order credit memo notification text to send to customers.
  • Order Credit Memo Notification to Admin: Enable order credit memo notification to admin.
  • WhatsApp Notification Text for Admin: Enter order credit memo notification text to send to the admin.


 

  1. Contact Inquiry Notification Settings
    Admin is notified whenever there is a new contact inquiry. To enable this feature, configure the following settings:
  • Contact Inquiry Notification: Enable new contact inquiry notification to admin.
  • WhatsApp Notification Text for Admin: Enter contact inquiry notification text to send to the admin.

  

 

  1. New Customer Registration Notification Settings
    The admin is notified when a new customer registration takes place. To enable this notification, the following settings are to be configured:
  • New Customer Registration Notification: Enable new customer registration notification to admin.
  • WhatsApp Notification Text for Admin: Add new customer registration notification text to send to admin.

 

  1. WhatsApp Notifications in Frontend
     
  • New Registration WhatsApp Notification to Admin
    When a customer registers a new account, admin is notified as shown below:

 

  • New Order Placement WhatsApp Notification to Customers
    A notification of acknowledgement of the order placement is sent to customers as shown here:

 

  • New Order Placement WhatsApp Notification to Admin
    Admin is notified when a new order is placed in the store as shown below:

 

  • Order Invoice Generation WhatsApp Notification to Customers
    When an Order Invoice is generated, a notification as shown below is sent to customers.

 

  • Order Invoice Generation WhatsApp Notification to Admin
    When an Order Invoice is generated, a notification is sent to Admin as shown here:

  
 

  • Order Shipment WhatsApp Notification to Customer
    Customers get notified at the time of order shipment via WhatsApp as shown below:

 

  • Order Shipment WhatsApp Notification to Admin
    Once the order gets shipped and shipment is generated, admin gets notified.

 

  • Refund Request WhatsApp Notification to Customer
    A customer gets notified of refund request approval as shown below:

 

  • Credit Memo Generation WhatsApp Notification to Admin
    Credit memo generation notification sent to admin as shown below:



 

  • New Contact Inquiry WhatsApp Notification to Admin
    Whenever a customer inquires through submitting the contact form, admin is notified as below: