我在用GOLANG
。
我试图使用google-calendar-API
向参与者发送通知。
我在calendar
包的文档中尝试了一些关于通过电子邮件发送通知的功能。(例如:SendNotifications
和SendUpdates
)
但他们都没用。
我已经在event
结构中附加了与会者,这样那些电子邮件所有者就可以自己在日历板上看到邀请,但没有收到任何电子邮件。
我的那部分代码:
立即创建事件:
event := &calendar.Event{
Summary: "Google calendar test",
Location: "800 Howard St., San Francisco, CA 94103",
Description: "go hiking!",
Start: &calendar.EventDateTime{
DateTime: "2022-01-05T10:00:00",
TimeZone: "Asia/Taipei",
},
End: &calendar.EventDateTime{
DateTime: "2022-01-05T11:00:00",
TimeZone: "Asia/Taipei",
},
Attendees: []*calendar.EventAttendee{
&calendar.EventAttendee{Email: "TESTINGGMAIL@gmail.com"},
},
}
插入事件:
calendarId := "primary"
event_notification := srv.Events.Insert(calendarId, event).SendUpdates("all")
event, err = event_notification.Do()
发布于 2022-01-09 01:51:58
解决
对我来说,答案是相当直接的(而且很愚蠢)。
由于我依赖google及其API( publish status
of OAuth被配置为我的“测试阶段”),我认为它需要与会者也成为所有相关工作的Test user
。
只需输入
Google cloud platform
->hit on the Navigation Menu at the left top
->API's & Services
->OAuth consent screen
然后点击+ ADD USERS
在Test users
部分,然后输入项目中与会者的电子邮件。
https://stackoverflow.com/questions/70622243
复制相似问题