Whatsapp Integration - Script Response
Overview
A new WhatsApp Integration feature has been introduced in the Backend. This feature allows users to send Script Responses and supported files to WhatsApp using configured templates or file references.
Accessing the Template
The Template option is available after creating a script and opening its Script Info section.
Steps
- Create/Add a new Script.
- Open the Script Info section.
- Click on the Template option.
- The Script Template page will open.
Script Template
The Script Template page contains the following sections:
- Configuration
- PDF Template
- SMS Template
- Email Template
Configuration
The Configuration section provides a Timezone option.
Timezone
Users can:
- Select the required timezone.
- Click Update to save the selected timezone.
PDF Template
The PDF Template section allows users to create and configure PDF templates.
Add New PDF Template
Add PDF Template Modal
The modal contains:
| Field/Action | Description |
|---|---|
| Template Title | Used to define the name of the PDF template |
| Add Template | Creates the new PDF template |
| Close (×) | Closes the modal |
Script PDF Template
After creating the PDF template, the user is redirected to the Script PDF Template page.
The page contains the following sections:
- Template Information
- Placeholders
- PDF Template
- PDF Configuration
Template Information
The configured Template Title is displayed at the top of the page.
Example:
Whatsapp Integration
Placeholders
The Placeholders section displays the dynamic values that can be used inside the PDF template.
Placeholder Categories
- Response
- System
Each placeholder also displays its usage Count.
Example
[Name]
[Mobile]
[Company_Name]
[Designation]
These placeholders can be used to dynamically populate the template with the relevant script or system data.
PDF Template Editor
The PDF Template section provides the following tabs:
- View
- Edit
- Preview
View
The View tab displays the configured HTML content of the PDF template.
The template can contain:
- HTML
- CSS
- Images
- Dynamic placeholders
- External URLs
- Page-break configuration
Example
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<style>
@page {
margin: 0;
}
.page-break {
page-break-after: always;
}
</style>
</head>
<body>
<!-- PDF Template Content -->
</body>
</html>
PDF Configuration
The PDF template provides additional configuration options.
| Configuration | Description |
|---|---|
| BG Image URL | URL of the background image |
| BG Size | Controls how the background image is displayed |
| Lock Ratio | Maintains the aspect ratio |
| Width | Defines the PDF width |
| Height | Defines the PDF height |
| Paper | Defines the paper size |
| Save | Saves the configured PDF template |
BG Image URL
The user can provide a background image URL.
Recommended Image Dimension:
794px × 1123px
BG Size
Defines how the background image should fit within the PDF.
Example:
Crop
Lock Ratio
When enabled, the aspect ratio between Width and Height is maintained.
Width and Height
Defines the dimensions of the PDF template.
Example
Width : 210
Height : 297
Paper
Allows the user to select the required paper size.
Example
A4
Save
Click Save to save the PDF template configuration.
WhatsApp Response Behaviour
The WhatsApp Integration supports sending the Script Response in different formats depending on whether a template is configured.
Template Configured
If a template has been added to the script, the Script Response will be sent through WhatsApp using the configured template.
The response will be generated in the configured template format.
Template Not Configured
If no template is configured for the script, the Script Response will be sent in link format instead of using a template.
Behaviour
Template Available
↓
Send Response using Configured Template
Template Not Available
↓
Send Response as Link
File Publishing Requirement
-
A file will be sent to WhatsApp only after the file has been published.
-
If a file has not been published, it will not be sent through WhatsApp.
Flow
File Created/Uploaded
↓
Publish File
↓
File Becomes Available
↓
Send File via WhatsApp
WhatsApp Eligibility
WhatsApp delivery is supported only when the recipient's mobile number uses the Indian country code +91.
If a country code other than +91 is used, the WhatsApp message will not be sent.
Example
| Country Code | WhatsApp Delivery |
|---|---|
+91 |
Supported |
Any country code other than +91 |
Not Supported |
Sending Files Without a Template
Files can also be sent through WhatsApp without creating a PDF template.
If the user wants to send a file such as an image, video, JPG, PNG, or PDF directly through WhatsApp, the file must first be uploaded and published through the required module.
Steps
File Sending Flow
Go to Module
↓
Upload File
↓
Publish File
↓
Get File_id
↓
Add file_id to Script
↓
Execute Script
↓
WhatsApp
↓
Configured File is Sent
Important:-
The file sent through WhatsApp will be the same file associated with the file_id added to the script.
Supported File Formats
The following file formats are currently supported for WhatsApp file delivery:
- mp4
- jpg
- png
Multi-File Support
Multi-file support is currently not available.
At present, the integration does not support sending multiple files together as part of the same WhatsApp response.
Change Response Format
To change the format/prefix used for the Script Response:
How to Access
Settings
↓
Codes
↓
Script Response Code Prefix
↓
Update Prefix
↓
Save
The updated prefix will be used for the Script Response accordingly.
WhatsApp Integration Flow
Create Script
↓
Open Script Info
↓
Select Template
↓
Script Template
↓
Configure PDF Template (Optional)
↓
Save Template
↓
Generate Script Response
↓
Check Template Configuration
↓
┌──────────────────────────────┐
│ Template Configured? │
└──────────────┬───────────────┘
│
┌──────┴──────┐
│ │
Yes No
│ │
↓ ↓
Configured Link Format
Template Response
│ │
└──────┬──────┘
↓
Check WhatsApp Eligibility
↓
Country Code must be +91
↓
Send via WhatsApp