Automate Your Weekly Calendar Summary with Apps Script

Updated February 22, 2026

Imagine starting every Sunday morning with a clear picture of your week ahead, delivered right to your inbox. No more scrambling through your calendar on Monday morning trying to figure out what meetings you have, who you're meeting with, or how packed your schedule looks. In this tutorial, I'll show you how to build an Apps Script automation that reads your Google Calendar and sends you a beautifully formatted email summary every week. You'll see exactly how many hours of meetings you have scheduled, along with details about each meeting including the organizer, attendee count, and your RSVP status. The best part? Once you set it up, it runs completely on autopilot.

Email showing a weekly summary of meetings and details for each meeting.

Prerequisites

This tutorial assumes the following prerequisites:

4 steps to implement the weekly calendar summary

Step 1 — Create a new Apps Script project

First, create a standalone Apps Script project. Navigate to script.google.com and click on New project. This creates a blank script file where we'll write our automation. Give your project a descriptive name like "Weekly Calendar Summary" by clicking on "Untitled project" at the top of the editor.

We'll use a standalone script rather than a bound script because this automation doesn't need to interact with any specific Google Sheet or Doc. It simply reads from your calendar and sends an email, so a standalone project keeps things clean and organized.

Step 2 — Write the calendar summary script

Now comes the main part of our automation. Delete any existing code in the editor and replace it with the script I'll walk you through. The script consists of several functions that work together: a main function that orchestrates everything, helper functions to format dates and times, a function to determine your RSVP status, and a function that builds the HTML email.

The main function, sendWeeklyCalendarSummary(), starts by calculating the date range for the next seven days. It then uses the CalendarApp service to fetch all events from your default calendar within that range. For each event, it extracts the title, organizer, attendee count, and your RSVP status, while also calculating the total meeting time by summing up the duration of non-all-day events.

Copy the full code from the "Full code" section below into your script editor. I'll explain how each part works in the "How the code works" section afterward.

Step 3 — Test the script manually

Before setting up the automatic weekly trigger, I always recommend testing the script manually to make sure everything works correctly. In the Apps Script editor, select sendWeeklyCalendarSummary from the function dropdown at the top, then click the Run button.

The first time you run the script, Google will ask you to authorize it. Click Review permissions, select your Google account, and grant the necessary permissions. The script needs access to your calendar to read events and access to Gmail to send the summary email.

After authorization, the script will run and send a test email to your inbox. Check your email to verify that the summary looks correct and contains all your upcoming meetings with the expected details.

Screenshot of an email titled 'Your Week Ahead' with a summary of meetings and details for each.

Step 4 — Set up the weekly trigger

The final step is setting up a time-driven trigger so the script runs automatically every Sunday morning. I've included a helper function called createWeeklyTrigger() that sets this up for you. Select this function from the dropdown and click Run.

This function creates a trigger that runs sendWeeklyCalendarSummary every Sunday at 8 AM. If you prefer a different day or time, you can modify the trigger settings in the code. For example, change ScriptApp.WeekDay.SUNDAY to ScriptApp.WeekDay.MONDAY if you'd rather receive the summary on Monday mornings, or adjust the atHour(8) to a different hour.

You can verify the trigger was created by clicking on the clock icon (Triggers) in the left sidebar of the Apps Script editor. You should see your new trigger listed there with the schedule "Weekly on Sunday, 8am to 9am."

Full code

Here is the complete code for the weekly calendar summary script. Copy and paste this into your Apps Script editor:

Newsletter Subscriber Exclusive

This section is exclusively available to newsletter subscribers. Subscribe below to access it.

By subscribing, you agree to our Privacy Policy and Terms of Service

Already a subscriber? Log in

How the code works

Let me walk you through the key parts of this script so you understand how everything fits together.

Fetching calendar events

The script begins by calculating the date range and fetching events:

var today = new Date();
var nextWeek = new Date();
nextWeek.setDate(today.getDate() + 7);
 
var calendar = CalendarApp.getDefaultCalendar();
var events = calendar.getEvents(today, nextWeek);

The CalendarApp.getDefaultCalendar() method retrieves your primary Google Calendar, and getEvents() returns all events within the specified date range. This includes both regular meetings and all-day events.

Calculating meeting time

For each event, the script calculates the duration in minutes, but only for non-all-day events:

if (!event.isAllDayEvent()) {
  var durationMs = event.getEndTime().getTime() - event.getStartTime().getTime();
  var durationMinutes = durationMs / (1000 * 60);
  totalMinutes += durationMinutes;
}

All-day events like holidays or reminders are excluded from the total meeting time calculation since they don't represent actual scheduled meetings that take up your working hours.

Determining RSVP status

The getMyRsvpStatus() function checks your response status for each meeting:

var status = guest.getGuestStatus();
 
switch (status) {
  case CalendarApp.GuestStatus.YES:
    return "Accepted";
  case CalendarApp.GuestStatus.NO:
    return "Declined";
  case CalendarApp.GuestStatus.MAYBE:
    return "Maybe";
  case CalendarApp.GuestStatus.INVITED:
    return "Not responded";
}

The function iterates through the guest list to find your email address and returns your RSVP status. If you're the organizer of the meeting rather than a guest, it returns "Organizer" instead.

Building the HTML email

The buildEmailBody() function constructs a nicely formatted HTML email with inline CSS styles. It creates a summary section at the top showing your total meeting count and time, followed by individual cards for each meeting. Each meeting card is color-coded based on your RSVP status: green for accepted, red for declined, yellow for maybe, and blue if you're the organizer.

Conclusion

You've just built a powerful automation that will save you time every week. Instead of manually checking your calendar to plan your week, you'll now receive a comprehensive summary delivered straight to your inbox every Sunday morning. The script handles all the complexity of reading calendar data, calculating meeting times, checking RSVP statuses, and formatting everything into a professional email.

Thanks for following along with this tutorial. I hope this automation helps you start your weeks with more clarity and less calendar anxiety.

Future work

Here are some ideas to extend this automation:

  1. Add calendar filtering: Modify the script to read from multiple calendars or exclude certain calendars (like birthdays) from the summary.
  2. Include meeting locations: Add the meeting location or video call link to each meeting card using event.getLocation().
  3. Flag meetings needing RSVP: Highlight meetings where you haven't responded yet so you can quickly address them.
  4. Add daily summaries: Create a second trigger that sends a daily morning summary of just that day's meetings.
  5. Compare to previous weeks: Store meeting time data in a spreadsheet and include a comparison showing whether this week is busier or lighter than your average.

DISCLAIMER: This content is provided for educational purposes only. All code, templates, and information should be thoroughly reviewed and tested before use. Use at your own risk. Full Terms of Service apply.