如何在Google日历中拥有插入事件的日志历史记录?

发布于 2025-01-29 14:08:16 字数 139 浏览 1 评论 0 原文

我有一个Google日历,启用一组大学可以插入活动。

我正在寻找一种追踪事件插入的方法,因此我可以知道插入了谁以及何时插入活动。

我浏览了网络,但这似乎是实现这些信息的唯一途径是至少拥有商务版。

有人可以提供帮助或提示吗?

I have a Google Calendar, where a set of collegues are enabled to insert events.

I'm looking for a way to trace the event insertion, so I can know who and when the event was inserted.

I surfed the web, but it seems the the only way to achieve these info is to have at least a business edition.

Is there anyone can which can help or give an hint?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

妞丶爷亲个 2025-02-05 14:08:17

如果您只需要以任何可读的方式通知您,那么最简单的是启用通过电子邮件通过电子邮件通知 calendar设置( “其他通知”部分,“新事件”下拉列表)

”设置示例“

In case you just need to be informed in any readable way, then the easiest one is to enable a bounce notification by email in calendar settings (section "Other notifications", the "New events" dropdown)

Settings example

洋洋洒洒 2025-02-05 14:08:16

如果我没记错的话,实现这一目标的唯一方法是使用报告API < /a>由于日历API对此没有手表方法,因此您也不需要更高的订阅。

我在Google Apps脚本中进行了此简短的示例脚本,该脚本比较了是否创建了事件,并将单独的电子邮件与诸如创建事件的人的电子邮件地址以及创建事件时的时间戳的信息。

理想情况下,它应该每天由触发器运行,或者可以改进脚本,以便触发器每隔几分钟或几个小时运行,甚至每天仅发送一封电子邮件,但这只是一个示例,说明了您的方式可以使用报告API来实现这一目标。

function myFunction()
{
  let today = new Date();
  today.setHours(00, 00, 00, 00);
  let request = {
    "eventName": "create_event",
    "filters": "[email protected]" // Calendar ID of the specific calendar that you want to check
  };
  result = AdminDirectory.Activities.list("all", "calendar", request);
  for(let i = 0; i<Object.keys(result.items).length; i++)
  {
    let time = new Date(result.items[i].id.time);
    if(result.items[i].actor.email=="[email protected]" && time >=today) // Compares the email address of the event creator (your colleagues) and the time it was created
    { 
      GmailApp.sendEmail("[email protected]", "Event creation alert", `Event creator: ${result.items[i].actor.email} \nTime: ${result.items[0].id.time}`);
    }
  }
}

参考:

If I am not mistaken the only way to achieve this would be using the Reports API since the Calendar API has no watch method for this and you would not need a higher subscription for it as well.

I did this short sample script in Google Apps Script that compares if an event has been created and sends a separate email with information such as the email address of the person that created the event and the timestamp of when the event was created.

Ideally it should be run by a trigger every day, or the script can be improved so that the trigger runs every couple minutes or hours or even send just a single email every day depending on your needs, but it is just an example of how you could use the Reports API to accomplish this.

function myFunction()
{
  let today = new Date();
  today.setHours(00, 00, 00, 00);
  let request = {
    "eventName": "create_event",
    "filters": "[email protected]" // Calendar ID of the specific calendar that you want to check
  };
  result = AdminDirectory.Activities.list("all", "calendar", request);
  for(let i = 0; i<Object.keys(result.items).length; i++)
  {
    let time = new Date(result.items[i].id.time);
    if(result.items[i].actor.email=="[email protected]" && time >=today) // Compares the email address of the event creator (your colleagues) and the time it was created
    { 
      GmailApp.sendEmail("[email protected]", "Event creation alert", `Event creator: ${result.items[i].actor.email} \nTime: ${result.items[0].id.time}`);
    }
  }
}

References:

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文