· 4 min · TextMeFlow Team

WhatsApp Reminders from Google Calendar with Apps Script

Plenty of freelancers and small teams simply schedule appointments in Google Calendar — no booking tool, no CRM, just a calendar with names, phone numbers and times in the description. If you want to hook an automatic WhatsApp reminder onto that, you don't need to switch to Calendly or an expensive automation tool straight away. With a free Google Apps Script and the TextMeFlow API, you can send a reminder every morning for tomorrow's appointments.

The idea

Apps Script runs for free inside any Google account and can run a function on a schedule (every morning at 8 a.m., for example). That function:

  1. Fetches all calendar events for tomorrow.
  2. Reads the phone number from the title or description of each appointment.
  3. Sends a POST request to the TextMeFlow API for each one.

No server, no hosting, no separate tool to maintain — everything runs inside Google.

What you need

  • A Google account with the calendar you want to use.
  • A free TextMeFlow account with a WhatsApp number paired via QR scan (see /en/docs/getting-started — no Meta Business verification needed).
  • Your API key from the TextMeFlow dashboard.

Step 1: make appointments recognizable

Make sure every calendar event contains a phone number your script can read. The simplest approach: put the number in international format (e.g. +32470123456) somewhere in the title or description, for example:

Title: Appointment Jan Peeters +32470123456

Step 2: the Apps Script

Open script.google.com, create a new project and paste the function below. Replace API_KEY with your own key.

function stuurHerinneringen() {
  const API_KEY = 'jouw-api-key';
  const calendar = CalendarApp.getDefaultCalendar();

  const morgen = new Date();
  morgen.setDate(morgen.getDate() + 1);
  const start = new Date(morgen.setHours(0, 0, 0, 0));
  const eind = new Date(morgen.setHours(23, 59, 59, 999));

  const events = calendar.getEvents(start, eind);
  const telefoonRegex = /\+\d{8,15}/;

  events.forEach(event => {
    const tekst = event.getTitle() + ' ' + event.getDescription();
    const match = tekst.match(telefoonRegex);
    if (!match) return;

    const payload = {
      to: match[0],
      text: `Reminder: tomorrow at ${Utilities.formatDate(event.getStartTime(), Session.getScriptTimeZone(), 'HH:mm')} you have an appointment. See you then!`
    };

    UrlFetchApp.fetch('https://api.textmeflow.eu/v1/messages', {
      method: 'post',
      contentType: 'application/json',
      headers: { Authorization: 'Bearer ' + API_KEY },
      payload: JSON.stringify(payload)
    });
  });
}

Step 3: set up the trigger

In the Apps Script editor, click the clock icon ("Triggers") on the left → Add Trigger. Choose the function stuurHerinneringen, event source "Time-driven", type "Day timer" and an hour of your choice (for example 8–9 a.m.). From now on the script runs every day automatically, even when your laptop is off.

Avoiding duplicate or wrong numbers

Two practical pitfalls:

  • Recurring appointments produce a separate event every day in getEvents() — that's no problem, each item is processed individually.
  • A wrong or missing number in the title simply causes that item to be skipped (the if (!match) return), rather than crashing the script. Check the execution logs in Apps Script now and then to see whether appointments are being skipped wrongly.

Why this doesn't land as spam

Every message is one-to-one and personalized with a time — exactly the kind of traffic that keeps WhatsApp numbers healthy. TextMeFlow also automatically applies rate limiting, a risk score and quiet hours to every outgoing message, whether it arrives via this script, a curl command or a no-code tool. You can read more at /en/docs/anti-spam.

When you do need a booking tool

This approach works great as long as phone numbers end up in the calendar manually or through a fixed template. As soon as customers book online themselves, a connection with a booking tool such as Calendly is often more robust — we described that scenario in WhatsApp reminders via Calendly webhooks. For larger volumes with multiple appointment types, a no-code tool like Make or n8n can scale more easily; see Send WhatsApp messages from n8n, Make.com or Zapier.

The free TextMeFlow plan gives you 50 messages a month, forever — plenty to test this script. For daily volumes, switch to Starter (€5/month) or higher.

Want to set this up today? Create a free account and pair your WhatsApp number in a few minutes.

Want to send WhatsApp messages via API yourself?

Free forever up to 50 messages/month. Scan a QR and send your first message within 5 minutes.

Free forever