This article demonstrates how to use and send a text template to a person on WhatsApp using WhatsApp by Gupshup.
What you'll need:
Skill level: Intermediate
Time required: 5 minutes
- Scheduler by Quickwork as a trigger--for triggering the journey
- WhatsApp by Gupshup
- Sandbox account in WhatsApp by Gupshup
- An app in WhatsApp by Gupshup running in your WhatsApp account
Configuring the trigger
- In the Event section, choose the Scheduler by Quickwork app from the drop-down menu in the Apps field present right below the New Trigger button.
- Select the trigger event as New scheduled event from the drop-down menu in the Triggers field.
- Set the Interval as per your choice based on how often you want the document to be merged.
- Set the date and time of your choice in the Start At field and keep the Custom Payload field empty.
- No authorization is required as this is an app created by Quickwork:
Configuring the action
- In the Steps section, click on the Simple Action button and choose the WhatsApp by Gupshup app from the drop-down menu in the Apps list.
- In the Actions list, select Send template message action. Click the Link account button. Specify the API key, Source number, and App name to link the Gupshup account. Click here to know how to connect. Since we are connecting a sandbox account, it contains a set of pre-configured templates of all types that neither be edited nor be deleted.
- In the Phone number field, enter the WhatsApp number of the person to whom you want to send the text template.
- In the Template type field, select Text. You can also select Image, Video, Document, and Location as a template too.
- In the Template ID field, select the name of the template you want to send. But before selecting it, let us understand what is a template and what parameters are needed to pass in Quickwork so that it acts as a pure text message to be sent on WhatsApp.
- Log in to your WhatsApp by Gupshup account through Google SSO. Then select the app using we established the connection of Gupshup with Quickwork e.g., kayoapp as shown in the screenshot:
- In the Advanced Settings page of the app, scroll down to the Template Messaging section. Then, enable the toggle button:
Note: It is mandatory to toggle ON the Template Messaging button else the journey won't send the template message to a user on WhatsApp.
- Then scroll down to the Test access API and set callback URL section and click the View templates button:
- This will take you to the Template List window in the new tab. This window contains a list of all Text templates that can be sent on WhatsApp. Refer to the following figure to understand what is the template name and parameters associated with it:
- The Element Name is the Template ID and variables enclosed in the curly brackets are the parameters to be defined by the user. The rest of the text message is static.
- Now, return to Quickwork and select the template ID as common_redeem_point (en_US) from the drop-down menu:
- Now move to the Params object. Since there are two variables for the text message, as shown in the previous screenshot, click the +Add New Item button. You'll have two Parameter input fields under Item 1 and Item 2 block, respectively. Specify the parameter value as per the example parameters shown in the screenshot:
- On complete configuration, the journey looks like this:
- Click the Save Changes button.
Activating the app on WhatsApp
Go to your WhatsApp by Gupshup account, click the kayoapp, and scroll down to the Smart mechanisms to get active and opted in users section. Go to the Click URL option and copy the URL: Paste it in the new tab to open it.
Paste it in the new tab to open it. The web version of WhatsApp will open with the pre-defined command PROXY kayoapp in the text field. Click the GO TO CHAT button:
If you are haven't linked the web version of WhatsApp, you'll be asked to do so. Send the command PROXY kayoapp to the WhatsApp by Gupshup chat account. You'll receive the welcome message confirming that the app is now connected successfully:
Executing the journey
Once the app is activated and the template messaging toggle button is enabled, return to Quickwork and click the Save & Start button. You'll be redirected to the History tab:
Once the journey execution is successful, you'll get a templatized message in the form of text on WhatsApp on behalf of WhatsApp by Gupshup:
In this way, you can send image, video, document, and location templates using WhatsApp by Gupshup; provided those template types are available within your app's sandbox or live account.