Setting up a customer initiated whatsapp conversation using IMIconnect

Whatsapp is among the top messaging services in the world with 1.2 Billion active users & 55 Billion daily messages . So, it makes absolute sense for a business to interact & engage with customers on whatsapp. You can message customers, send them alerts, notifications, and updates, and answer any questions they may have all using their preferred channel. Here is a simple whatsapp tutorial to give you a glimpse of what you do with Whatsapp & IMIconnect

📘

Usecase

•Customer initiates a conversation with the business on whatsapp to request for an eBook download
•Business promptly responds to the customer and captures his name & email.
•Business sends the eBook to the customers email
•Finally the business notifies the customer about successful eBook delivery through whatsapp

Step 1 : Create a Service

You can get started with a Service on IMIconnect within seconds. Start by clicking here.

Step 2 : Setup whatsapp channel on IMIconnect

For detailed steps click here.

Step 3 : Create a new flow with whatsapp as the trigger

For detailed steps on creating a new flow click here.
On the "Select Trigger Category" screen; select whatsapp ( listed under channels) as the trigger.

Configure Whatsapp Trigger Event

  1. Once you land on the "Configure Whatsapp Event" dialog , Select "Incoming Message" from the dropdown of Select an Event.
  2. Create a custom variable userId to capture the whatsappId to be used as part of the next nodes. For detailed steps on creating a custom variable , click here.
1525

Select the tab "Transition Actions ( optional) "
You can configure the node on-enter/on leave operations by adding actions. Now let us assign 'whatsappId' of the user to the variable 'UserId'

  1. Click on +Add action
  2. Select On-leave from the TIME drop down
  3. Set the ACTION to be "Set variable"
1515
  1. Select the variable 'userId' from the VARIABLE drop down.
  2. Place the cursor in the VALUE text box & select the variable "whatsapp.waId" available under the Output variables>Start>whatsapp.waId as show in the below picture
1526
  1. SAVE the whatsapp trigger event node to proceed further

Step 4 : Configure the welcome message node

Create & configure whatsapp node

  1. Drag and drop a Whatsapp from the node palette to the left of the screen, under the UTILITIEStab.
  2. Connect the "Whatsapp trigger node" with the new "Whatsapp" node by dragging the green dot on trigger node towards the whatsapp node .
  3. Double-click on the new Whatsapp node to configure its parameters. You will arrive at the configuration window. Rename the node , for eg - "Welcome message node".
  4. Configure the node as follows
  • Set DESTINATION TYPE as WA ID
  • Set DESTINATION as $(n2.whatsapp.waId) by picking the variable from Input Variables>Start>whatsapp.waId available on the right pallete.
  • Configure an appropriate welcome message.
1513
  • Configure the timeout parameters
  • Set WAIT FOR as Read with a TIME OUT of 50 Secs
  • SAVE the whatsapp welcome message node
1118

Configure Exception handling for the node

  • Setup onError exception
  • Setup onPolicyFail exception
  • Setup onDeliveryFail exception
  • Setup the onTimeOut event for the whatsapp node
For detailed steps on configuring exception handling click here.

Step 5 : Setup the Receive node to receive customer response

Create a configure the receive node

  1. Drag & drop Receive node from the left pallete & double click to open up the following dialog.
  2. Connect the Whatsapp welcome message node to Receive node
  3. Select Receive Whatsapp message as the incoming message event
1129
  1. Setup the Max timeout as 300
  2. Set the FROM WHATSAPP ID field to $(n2.whatsapp.waId) by picking it from right hand pallete ( Input variables > Start > whatsapp.waId )
1515

Configure the Transition actions on the receive node

Select the tab "Transition Actions ( optional) "
You can configure the node on-enter/on leave operations by adding actions. Now let us assign 'response' of the user to the variable 'userName' ( The custom variable userName has to be created before it can be used , click here for detailed steps )

  1. Click on +Add action
  2. Select On-leave from the TIME drop down
  3. Set the ACTION to be "Set variable"
  4. Select the variable 'userName' from the VARIABLE drop down.
  5. Place the cursor in the VALUE text box & select the variable "receive.message" available under the Output variables>Start>receive.message as show in the picture below
  6. SAVE the Receive node
1516

Configure Exception events for the Receive node

  • Setup onError exception
  • Setup onTimeOut exception
    For detailed steps click here.

Step 6 : Configure the whatsapp message node for requesting email

  1. Follow the same steps as prescribed in Step 4
  2. Create the node, configure the node as follows
    Setup
  • Set DESTINATION TYPE as WA ID
  • Set DESTINATION as $(n2.whatsapp.waId) by picking the variable from Input Variables>Start>whatsapp.waId available on the right pallete.
    • Configure a custom message to request for user email
1119
  1. Connect the Receive node success event to Ask for email whatsapp node.

Configure Exception events for the whatsapp node

  • Setup onError exception
  • Setup onTimeOut exception
    For detailed steps click here.

Step 7 : Configure the receive node for capturing email

  1. Follow the steps mentioned in Step 5 to create & configure the receive node.
  2. Setup the "FROM WHATSAPP ID" after selecting "RECEIVE WHATSAPP MESSAGE"
  3. Assign the user response to custom variable "userEmail"
1114

Configure Exception events for the receive node

  • Setup onError exception
  • Setup onTimeOut exception
    For detailed steps click here.

Step 8 : Configure the Evaluate node to validate the email

The evaluate node uses JavaScript to perform logic and return the values which are tested against predefined 'choices'. Each choice is a unique value, that when encountered directs the flow to the linked node. For more details on evaluate node click here.

In this step, we will use the evaluate node to validate the email id given by the user and invoke the Invalid Email Id or Valid Email Id flow appropriately.

  1. Drag and drop an Evaluate node from the node palette to the left of the screen, under the UTILITIEStab.
  2. Double-click on the Evaluate node to configure the Javascript & the script output.
1126
  1. Use the below Javascript for validating the user email.
var eml = useremail; if ( eml.indexOf("@") >= 0) "1"; else "0";
  1. Configure the Script Output as follows
SCRIPT OUTPUTBRANCH NAME
1Valid Email Address
0Invalid Email Address
  1. SAVE the node configuration

Step 9 : Configure the Invalid Email Id flow

Prompt the user about invalid email

  1. Create & configure the whatsapp message node, follow Step 4 for details
  • Set DESTINATION TYPE as WA ID
  • Set DESTINATION as $(n2.whatsapp.waId) by picking the variable from Input Variables>Start>whatsapp.waId available on the right pallete.
    • Configure a custom message to prompt the user about Invalid emaild & request for correct user email
  1. Connect the Invalid Email Address flow of Evaluate node to the invalid email whatsapp message node.
1134
  1. Connect the onSuccess flow of Prompt invalid email node to Capture Email Receive node.

Configure Exception events for the whatsapp node

  • Setup onError exception
  • Setup onTimeOut exception
    For detailed steps click here.

Step 10 : Configure the Valid Email Id flow

Create & configure the Send Email node.

  1. Drag & drop Email node from the left pallete &
  2. Double click send eGuide email node to configure as follows -
  • Select EmailId from the DESTINATION TYPE dropdown
  • Set DESTINATION ID as $(userEmail)
  • Set FROM EMAIL & FROM NAME
  • Select Text as the EMAIL TYPE (or) Alternatively you can use email templates created on email composer. To know more on email composer click here.
  • Set the SUBJECT & MESSAGE BODY with the appropriate response message.
1138
  1. Connect the Valid Email Id flow of the evaluate node to the send eGuide email node.

Configure Exception events for the email node

  • Setup onError exception
  • Setup onPolicyFailure exception
    For detailed steps click here.

Create & configure the whatsapp acknowledgement node

On success of the email delivery, the user can be notified with a whatsapp message.

  1. Create & configure the whatsapp message node, follow Step 4 for details
  • Set DESTINATION TYPE as WA ID
  • Set DESTINATION as $(n2.whatsapp.waId) by picking the variable from Input Variables>Start>whatsapp.waId available on the right pallete.
    • Configure a custom message to notify the user of the successful email delivery
  1. Connect the onSuccess event flow of "Send eGuide Email" node to whatsapp acknowledgement node
1121

Configure Exception events for the email node

  • Setup onError exception
  • Setup onPolicyFailure exception
    For detailed steps click here.

Step 10 : Test using whatsapp

  1. Add the number configured for your whatsapp business account to your mobile contacts
  2. Find the Business Account on whatsapp messenger & initiate the conversation.