You can use the instructions below to send WhatsApp Messages from to multiple recipients stored in a Google Sheet table. Google Sheet will use a script created in Google Scripts to send the message through the API.
Requirements:
– You need to get an APIkey first. Click here to get one.
– Connect your phone number to the API (follow the instructions received by email)
– You need a Google Account to use Google Sheets and Google Scripts
Important! Remember that sending Spam is not allowed. If you send too many messages to unknown recipients, WhatsApp might assume that you are sending spam and they can block your account.
Instructions
You can reuse the Google Script created here.
1) When you open the Google Sheet using the link above, you need to “Make a Copy” in order to modify the table
Then, click “Make a Copy”.
Now, you have your own copy of the Google Sheet and Google Script Files that you can modify yourself. Only you have access to those new copied files.
2) Modify the APIkey, Recipient and Message from the Table.
You can use the “Variable1” Column to dynamically build the Message like in the row #3. Note: If you need to add more variable, you have to add them after the “Sent Date” column. Otherwise you will need to change the Google Script code.
3) Use the “Send WhatsApp” menu to send the messages.
4) You can click “Send a Test Message with First Row” to send a test using the entry in Row#2 (first entry). Or Send to All to go through the table and send one message per row based on your inputs.
5) Every time that a message is sent, the columns “Status” and “Sent Date” will be automatically completed with the result of the API request and the timestamp when the API was called.
Please note that there is a delay on 8 seconds bewtween messages. This is coded in the Script. If you seend too many messages per second, then whatsapp might asume that you are sending spam and they can block your account. You can change the delay from the Google Script. code: Utilities.sleep(8000); //Delay between messages in miliseconds
Giving permissions to Google Script
The first time that you run the script using the Menu, Google will ask for an Authorization to execute the Script that will call to the API to send the messages. Rember that the script is now owned by you so only your account will have access to the Google Script. You can also modify the script if needed.
1) Click OK when Google ask for Authorization
2) Select your Account. That means that you are giving permisons to yourself to execute the Script.
3) There is a security Warning because the Scrip has not been Verified. This is normal because it is a new script that you have just created (copied).
Click on Advanced
4) Now that you have the Advanced options, click on “Go to your Project (unsafe)”
5) Allow the “Send WA Message Script” to See, Edit and delete your Google Sheet file. This is needed so the Script can get the list of recipients and also write the output of each API executing in the Status column.
That’s it! This Authorization is only required once the first time that you execute the script from Google Sheet.
View or Edit the Google Script Code
1) Go to “Extensions”, and click “App Script”
2) Google Script will open the Send WA Message Script. Remember that this is your own copy of the Script and you can modify the code yourself