Apps Script lets you add guests to calendar events, send invites, and check attendee responses — all programmatically. This is useful for automatically scheduling onboarding sessions, team meetings, or client calls from spreadsheet data.
Adding a Guest When Creating an Event
Pass a guests option when creating the event:
functioncreateOnboardingWithInvite(){var calendar =CalendarApp.getDefaultCalendar();var start =newDate("2024-03-26T14:00:00");var end =newDate("2024-03-26T15:00:00");var event = calendar.createEvent("Pro Plan Onboarding – Sarah Johnson", start, end,{description:"Welcome onboarding session for Sarah Johnson's Pro Plan account.",guests:"[email protected]",sendInvites:true});Logger.log("Invite sent to [email protected]");}
Adding Multiple Guests
Pass a comma-separated string of email addresses:
functioncreateTeamSyncWithAttendees(){var calendar =CalendarApp.getDefaultCalendar();var start =newDate("2024-03-25T09:00:00");var end =newDate("2024-03-25T09:30:00");var event = calendar.createEvent("Weekly Sales Sync – North & East Regions", start, end,{guests:"[email protected],[email protected]",sendInvites:true});Logger.log("Team sync created with "+ event.getGuestList().length+" attendees.");}
Inviting Customers from Sheet Data
This example creates an onboarding session for every newly closed deal and invites the customer automatically:
With the sample data, onboarding sessions are created for Sarah Johnson (Pro Plan) and Lisa Park (Starter Plan), with both the customer and their sales rep invited.