Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I send an invitation to the guest by Google Apps Script for Calendar

I am trying to add a guest to a Calendar event by Google Apps Script and to send an invitation as soon as my script add a guest. But I can't find a method to send an email invitation to the guest.

var events = calendar.getEvents(start_date, end_date)
event.addGuest('[email protected]');

Is there any way to send an invitation to the guest from Apps Script?

I rewrote with Advanced Google Services but still the guest I have added can't get invitation email.

var body = {
  'sendNotification': true,
  'attendees': attendees
};

var ret = Calendar.Events.patch(body, calendarId, eventId);
like image 387
Daisuki Honey Avatar asked Oct 22 '25 07:10

Daisuki Honey


1 Answers

You can with Calendar in Advanced Google Services, for example:

var event = Calendar.Events.get(calendarId, eventId);
Calendar.Events.patch(event, calendarId, eventId, {sendNotifications: true});

Sets the sending of notifications to true

See the documentation on Calendar in the Advanced Google Services.

like image 101
Bardy Avatar answered Oct 25 '25 12:10

Bardy