Automated reminders for Google Calendar using Google Apps Script.
This project scans calendar events for a shared reminder tag defined in CONFIG.reminderTag and schedules reminder emails to event guests ahead of time. Reminders are scheduled by creating time-based triggers that send emails later.
scheduleForCalendars()runs on a schedule (daily) and scans calendars listed inCONFIG.calendarIds.- For each calendar event on the target day(s), it checks for
CONFIG.reminderTag. If that tag is present on its own, the event gets the default reminders defined inCONFIG.reminderSchedules. If a matching reminder param is also present, it can narrow that down or opt in to same-day reminders. - If the tag and schedule param match, it builds an email and creates a time-based trigger to send it later that day.
- When the trigger fires,
sendReminderEmailFromStore()sends the email and logs it to a spreadsheet.
- Reminder offsets and time windows are configured in
CONFIG.reminderSchedules. daysAhead: 0schedules a same-day reminder relative to the meeting start time, according to the value inhoursBeforeEvent.- If a target reminder day lands on a weekend (as defined by
CONFIG.weekendDays), it is pushed forward to the next workday. - The script does not schedule new reminders on weekend days (also based on
CONFIG.weekendDays).
The project config defines:
reminderTag: Required marker that must appear in the event description.reminderTagon its own applies every configured reminder inCONFIG.reminderSchedulesexceptdaysAhead: 0.daysAhead: 0reminders are opt-in only and require the matching param, for examplereminder_days=0.reminderParam: Shared parameter name used to restrict schedules bydaysAhead, for examplereminder_days=1,7.- The param syntax is strict: use a single token like
reminder_days=1,7with no spaces around=.
Example event description snippets:
#reminder_emailschedules the default non-zero reminders defined inCONFIG.reminderSchedules.#reminder_email reminder_days=0schedules only the same-day reminder.#reminder_email reminder_days=1schedules only the 1-day reminder.#reminder_email reminder_days=1,7schedules the 1-day and 7-day reminders.Contact: Mike Anthony, m.a@my-org.orgadds the contact person to the reminder email footer and uses their email as the reminder's Reply-To address when the email domain matchesCONFIG.contactEmailDomain.- If you change
CONFIG.reminderTagto#board_reminder, then#board_reminder reminder_days=7becomes the matching form.
Use the labels Agenda:, Zoom:, and Contact: in the event description. Put the reminder tag on its own line near the bottom so it is easy to spot and edit.
Default reminders, such as 1 day and 7 days ahead:
Agenda: https://docs.google.com/document/d/mock-agenda-id/edit
Zoom: https://my-org.zoom.us/j/123456789?pwd=mockpass
Contact: Mike Anthony, m.a@my-org.org
#reminder_email
Same-day reminder only, sent according to the daysAhead: 0 schedule:
Agenda: https://docs.google.com/document/d/mock-agenda-id/edit
Zoom: https://my-org.zoom.us/j/123456789?pwd=mockpass
Contact: Mike Anthony, m.a@my-org.org
#reminder_email reminder_days=0
Same-day, 1-day, and 7-day reminders for the same event:
Agenda: https://docs.google.com/document/d/mock-agenda-id/edit
Zoom: https://my-org.zoom.us/j/123456789?pwd=mockpass
Contact: Mike Anthony, m.a@my-org.org
#reminder_email reminder_days=0,1,7
autoreminder.gs— entry points and scheduling flowcalendarUtils.gs— parsing event description links and reminder schedule matchingconfig.js— configurationspreadsheetLogId: Spreadsheet ID for logs.calendarIds: Array of calendar IDs.timezone: Timezone used for day calculations.reminderTimezone: Timezone used in email formatting.reminderTag: Shared tag in event descriptions (for example#reminder_email).reminderParam: Shared param in event descriptions (for examplereminder_days).contactEmailDomain: Allowed domain forContact:email parsing (for examplemy-org.org).weekendDays: ISO weekday numbers (1=Mon ... 7=Sun).reminderSchedules: Array of objects. Future-day reminders use{ daysAhead, minHour, maxHour }; same-day reminders use{ daysAhead: 0, hoursBeforeEvent }.
dateUtils.gs— date math and weekend handlingemailScheduler.gs— trigger storage + sendingReminderComposer.gs— email composition
Manual setup with Google Apps Script
- Create a new Apps Script project in Google Drive.
- Copy the files from this repo into the Apps Script project.
- In
config.js, fill in:spreadsheetLogId(spreadsheet that has aLogssheet)calendarIds(list of calendars to scan)
- In the spreadsheet, ensure a sheet named
Logsexists.
Apps Script will prompt for permissions on first run:
- Calendar (read events)
- Mail (send email)
- Spreadsheet (write logs)
- Script (create time-based triggers)
Advanced setup with clasp
- Node.js installed
claspinstalled globally:
npm install -g @google/claspclasp login
clasp create --type standalone --title "gcal-autoreminder"This creates a .clasp.json linked to your Apps Script project.
From the repo directory:
clasp pushIf you want a versioned deployment (e.g. for sharing or running as an add-on), create a deployment:
clasp deploy --description "Initial deployment"List existing deployments:
clasp deploymentsIf you created the script in the Apps Script UI and want to download it:
clasp pullCreate a time-based trigger that runs scheduleForCalendars() once per weekday (or every day if you want it to decide). You can do this in the Apps Script UI or via clasp:
In the Apps Script UI:
- Triggers (clock icon) → Add Trigger
- Choose function:
scheduleForCalendars - Event source: Time-driven
- Type: Day timer (choose a time)
- Add a test event with the shared reminder tag in the description, for example
#reminder_emailor#reminder_email reminder_days=1. - Add
Contact: Mihail Anton, mihail.anton@my-org.orgto the event description to verify the contact block is appended near the bottom of the email. - Send a test reminder and use your email client's Reply action to verify that it addresses the parsed contact email.
- Temporarily set a reminder schedule to
daysAhead: 0withhoursBeforeEventand use a test event far enough in the future for the trigger to be created. - Check the
Logssheet for sent emails.
- Emails are sent as BCC to event guests; the "To" field is the script owner.
- The script avoids sending reminders on weekend days.