【问题标题】:What parameters are required to set Google Calender Notification time设置谷歌日历通知时间需要哪些参数
【发布时间】:2023-02-09 11:29:05
【问题描述】:

我必须将谷歌日历通知时间从 30 分钟更改为 5 分钟。

const encodedUrl = encodeURI(
    [
      "https://www.google.com/calendar/render",
      "?action=TEMPLATE",
      `&text=${calendarEvent.title || ""}`,
      `&dates=${startDate || ""}`,
      `/${endDate || ""}`,
      `&add=elf1@example.com,elf2@example.com`,
      // TODO: append video appointment link to description
      `&details=${`${calendarEvent.description}\n` || ""}`,
      `&location=${calendarEvent.address || ""}`,
      "&sprop=&sprop=name:"
    ].join("")
  );

使用上面的 URL 字符串,我可以设置事件标题、事件时间和事件位置参数,但通知时间除外。但是现在我想在上面的链接中更新日历事件中的通知时间,这可能吗?

【问题讨论】:

    标签: javascript reactjs google-calendar-api


    【解决方案1】:

    来自Calendar APIEvents 资源包含一个reminders 属性,可用于管理事件通知。

    因此,您可以通过将 reminders 属性添加到您的负载来通过 Events: patchEvents: update 更新事件通知。

    例如,如果您在 Google Apps Script 上调用此 API,您将执行如下操作:

    const resource = {
      reminders: {
        overrides: [
          {
            method: "popup", // options: "popup", "email"
            minutes: 5
          }
        ]
      }
    }
    Calendar.Events.patch(resource, calendarId, eventId);
    

    如果您需要有关如何使用 Calendar API 的更多信息,请查看可用的不同快速入门,例如 this one for JavaScript

    参考:

    【讨论】:

      猜你喜欢
      • 2019-07-07
      • 2020-11-04
      • 1970-01-01
      • 1970-01-01
      • 2020-08-06
      • 1970-01-01
      • 2016-03-22
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多