close
close
Guide

How to Send Personalized Text Messages from Google Sheets

Send personalized text messages in bulk from Google Sheets using your favorite SMS service

The Document Studio add-on helps you to automatically send text messages when a new Google form is submitted or when new rows are added to Google Sheets. In this way, you can set up workflows that send reminders via SMS when the invoices are due. Or you can get instant notifications when people fill out your Google Forms.

The SMS workflow

The text messages in Document Studio are sent through Twilio, but the app can integrate with any SMS service as long as the service provides an API to send text messages programmatically. You can use TextMagic, SimplyTexting, Vonage, ClickSend, RingCentral or any SMS service of your choice.


SMS google spreadsheets

For this example, we have a Google Sheet that contains the customer’s name, phone number, invoice number, and amount due. Google spreadsheet column A titled Send Reminder check box and the SMS should only be sent for lines in which this check box is activated.

Format the phone numbers

Telephone numbers in column D should conform to the E.164 international format and have a maximum of 15 digits.

[+][country code][area code][local phone number]

We added another column titled to the sheet Phone Number and this uses a Google Sheets function to remove all non-numeric characters from the customer’s phone number. Paste this function into cell D2.

=BYROW(C2:C11,LAMBDA(Phone, REGEXREPLACE(Phone,"\D","")))

If you prefer to use ArrayFormulas instead of the new ones BYROW Function would be the modified formula:

=ArrayFormula(REGEXREPLACE(C2:C11,"\D",""))

1. Create an SMS workflow

With our source data prepared in Google Sheets, let’s create a workflow to send SMS messages. Start Document Studio and create a new workflow.

Read  Kitchen Shrink: How to gracefully slide into fall foods


SMS workflow

2. Specify the sending criteria

On the next screen, select the Process specific rows option and specify the criteria for when billing reminders should be sent via SMS. We specified two conditions in our example:

  • The check box should be checked or TRUE
  • The phone number field cannot be empty


Send SMS criteria

3. Configure the SMS service

Next, proceed to the Tasks screen and select Webhooks from the list of services. We will essentially be making an HTTP POST request to the SMS service provider’s API to send the text message.

And this request will be different for each SMS service depending on their API endpoints.


Webhook SMS service

3a. Send SMS with TextBelt

Go to textbelt.com and create an API key. You can send the first SMS message for free with textbelt as your API key.

Set in the webhook service POST as the request method and the request url as https://textbelt.com/text.

Switch to Request Body tab and set the content type as application/json. The message field contains the text Dear {{customer name}} - your invoice # {{ invoice number }} for {{invoice amount}} is due. while the phone field contains the values ​​of {{ phone number }} Google sheet column.


SMS TextBelt

3b. Send SMS with TextMagic

Create an account on TextMagic.com, go to the API settings page and click the Add new API key Button to generate a new secret key.

Set the request url as https://rest.textmagic.com/api/v2/messages and add two header fields – X-TM-Username and X-TM-Key to include the username or API key. The request body should contain the parameter phones for the recipient’s phone number and text for the SMS text.

Read  How to Watch the Super League Toulouse Livestream – Triathlete

You can optionally add the sendingDateTime Parameters in the request body to schedule text messages and send them at a later time. The full list of parameters can be found in the API docs.


TextMagic SMS

3c. Send SMS with ClickSend

If you prefer the ClickSend service for sending text messages, set https://rest.clicksend.com/v3/sms/send in the URL field with the request method set as POST. Choose Basic OAuth under the Authorization and enter your username and API key in the user and password fields respectively. You can get the credentials from your ClickSend dashboard.

For the request body, enable the Use Raw Input Option and content type set to application/json. Paste the following JSON code into the text box. The Sender ID can be either a company name or a cell phone number and can be used by the recipient to identify who sent the message.

{
  "messages": [
    {
      "from": "your_sender_id_goes_here",
      "to": "{{ phone number }}",
      "body": "Dear {{ customer name }} - your invoice #{{ invoice number }} for {{ invoice amount }} is due.",
      "source": "Document Studio"
    }
  ]
}


Click Send SMS

4. Activate the SMS workflow

Now that you have configured the workflow to send SMS using your favorite SMS app, go to Save screen in Document Studio and select Save and Run to send the text messages to your customers.

You can also enable the Time Delay option to delay sending text messages until a condition is met. For example, you can only send text messages when the invoice due date is after 5 days.


Run the SMS workflow

See also: 🐘 Automate workflows with Google Sheets

Read  How To Craft And Play Mesa – Warframe

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button