google-apps-script - 使用 Google 应用脚本编辑 Google 日历事件时更新与会者

标签 google-apps-script google-calendar-api icalendar

情况
我有一个日历,上面有很多事件(员工评估)。
我进行了大量修改(更改事件的长度等),但邀请对象是拥有 Lotus Notes 日历的人(穷人)。
这意味着除非我触发所谓的“发送通知?”在鼠标点击的版本中,他们无法知道事件已更新。
( Similar Q )
example of the update triggering
在此示例中,我尝试触发的事件与发送更新时触发的事件相同?发送时接受模态。
代码
下面是一些示例代码,用于获取 Appraisals 上的所有事件。日历并将它们的位置更改为“月亮”。

function fixInvitations(){
  //get the callendar named "Appraisals"
  var cApp = CalendarApp.getCalendarsByName("Appraisals")[0];
  var events = cApp.getEvents(new Date(), new Date("Dec 30 2014"));

  for (eIndex in events){
    var event = events[eIndex];
    event.setLocation("the moon");
  }
}

如何触发对受邀参加事件的所有各方的更新,以便更改反射(reflect)在他们的日历中?
目前,这些事件已经在月球上进行,但更新并未告诉非 Google 日历上的人有关更改的信息。
有用,但不是那么有用的事实
手动触发发送的更新邮件包含 .ics文件 ( Gist of the contents )。这包含一个 VCALENDAR 和一个 VEVENT。来自 Wikipedia page on VEVENTs

For sending an UPDATE for an event the UID should match the original UID. the other component property to be set is:

SEQUENCE:<Num of Update>

I.e., for the first update:

SEQUENCE:1


因此,如果有一种方法可以手动构建带有 .ics 的电子邮件附件它会解决问题,但这感觉就像是大材小用。 This is mentioned here但没有解决。

最佳答案

Google Calendar API 支持事件更新的标记 sendNotifications:
https://developers.google.com/google-apps/calendar/v3/reference/events/update

我会向 App Script 提交功能请求以公开标志,同时直接使用 Calendar API 来更新事件,就像外部 API 一样:
https://developers.google.com/apps-script/guides/services/external

关于google-apps-script - 使用 Google 应用脚本编辑 Google 日历事件时更新与会者,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22187070/

相关文章:

javascript - 仅选择一项时如何处理多项选择

node.js - Google OAuth - 授权时无法读取未定义的属性 '0'

python-3.x - 如何使用 Google Calendar API 创建 "all-day"事件

java - 无法加载事件数据 - 使用 Java 发送 .ics 时在 gmail 中

ruby-on-rails - 如何查看日历邀请邮件中的 ics 文件?

google-apps-script - 如何下载以前保存的Google Apps脚本修订版?

javascript - getBody 在 Apps 脚本中始终返回 null,即使我认为应该这样编写

python - 在 google api python 客户端上删除辅助日历会出现意外错误

php - 将自定义 (PHP) 日历与 iCal/Google 日历同步?

google-apps-script - Google Apps 脚本中 ui.alert 窗口中的分割线和粗体文本