簡體   English   中英

GO:“SendUpdates”在使用谷歌日歷時不起作用 API

[英]GO : "SendUpdates" not working when using google calendar API

我正在使用GOLANG

我正在嘗試使用google-calendar-API向參與者發送通知。

我在calendar package 的文檔中嘗試了一些功能,其中提到了通過 email 發送通知。 (例如: SendNotifications & SendUpdates

但他們都沒有工作。

我已在event結構中附加了與會者,因此那些 email 所有者可以自己在日歷板上看到邀請,但不會收到任何 email。

我的部分代碼:

創建事件即時:

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()

[解決]

對我來說,答案很直接(而且很愚蠢)。

由於我依靠谷歌雲平台及其 API(OAuth 的publish status已被我配置為“測試階段”),我認為它要求與會者也是所有相關事物的Test user要完成。

只需輸入您的

Google cloud platform
->hit on the Navigation Menu at the left top
->API's & Services
->OAuth consent screen

並單擊“ Test users ”部分下的+ ADD USERS ,然后輸入項目中出席者的電子郵件。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM