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

落花浮王杯 提交于 2019-12-24 00:26:49

问题


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('guest_email@gmail.com');

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);

回答1:


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.



来源:https://stackoverflow.com/questions/40842714/how-can-i-send-an-invitation-to-the-guest-by-google-apps-script-for-calendar

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!