If you have a list of customers, their Name, numbers, and a message for them, this script can make your task easy.
For example: if you want to send birthday wishes.
Follow this simple trick to automate WhatsApp Messages with Google Sheet and AppScript Code.
Create a Google sheet with data as mentioned in step 1.
Then just copy the script mentioned in step 2 to the appscript editor.
Now click on – Run.
This script will open all messages one by one, you just need to click send button.
function openLinks() {
var sheet = SpreadsheetApp.getActiveSheet();
var range = sheet.getRange(“A2:E”);
var values = range.getValues();
for (vari = 0; i < values.length; i++) {
var CountryCode = values[i][0];
var PhoneNumber = values[i][1];
var Name = values[i][2];
var Message = values[i][3];
var url=””;
if (CountryCode != “” && CountryCode != null) {
url=”https://api.whatsapp.com/send?phone=”+CountryCode+PhoneNumber+”&text=Hi%20″+Name.replace(/ /g,”%20″)+”%2C%0A”+Message.replace(/ /g,”%20″);
Utilities.sleep(10000);
var html = “<script>window.open(‘” + url + “‘, ‘_blank’);</script>”;
var userInterface = HtmlService.createHtmlOutput(html);
SpreadsheetApp.getUi().showModalDialog(userInterface,”Opening URL”);
}
}
}