如何通过 Google Apps 日历脚本向客人发送邀请

Dai*_*ney 4 google-calendar-api google-apps-script

我正在尝试通过 Google Apps 脚本将访客添加到日历活动,并在我的脚本添加访客后立即发送邀请。但我找不到向客人发送电子邮件邀请的方法。

var events = calendar.getEvents(start_date, end_date)
event.addGuest('guest_email@gmail.com');
Run Code Online (Sandbox Code Playgroud)

有没有办法从 Apps 脚本向访客发送邀请?

我用高级 Google 服务重写了,但我添加的访客仍然无法收到邀请电子邮件。

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

var ret = Calendar.Events.patch(body, calendarId, eventId);
Run Code Online (Sandbox Code Playgroud)

Bar*_*rdy 5

您可以使用高级 Google 服务中的日历,例如:

var event = Calendar.Events.get(calendarId, eventId);
Calendar.Events.patch(event, calendarId, eventId, {sendNotifications: true});
Run Code Online (Sandbox Code Playgroud)

将通知发送设置为 true

请参阅高级 Google 服务中有关日历的文档。