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 every reminder defined inCONFIG.reminderSchedules. If a matching reminder param is also present, it can narrow that down. - 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. - 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.reminderSchedules.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 every reminder defined inCONFIG.reminderSchedules.#reminder_email reminder_days=1schedules only the 1-day reminder.#reminder_email reminder_days=1,7schedules the 1-day and 7-day reminders.Contact: Mihail Anton, mihail.anton@elixir-europe.orgadds the contact person to the reminder email footer when the email domain matchesCONFIG.contactEmailDomain.- If you change
CONFIG.reminderTagto#board_reminder, then#board_reminder reminder_days=7becomes the matching form.
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 exampleelixir-europe.org).weekendDays: ISO weekday numbers (1=Mon ... 7=Sun).reminderSchedules: Array of objects{ daysAhead, minHour, maxHour }.
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@elixir-europe.orgto the event description to verify the contact block is appended near the bottom of the email. - Temporarily set a reminder schedule to
daysAhead: 0and a narrow time window. - 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.