我添加了将谷歌日历与我的应用程序事件同步的功能。但问题是,只要活动参与者回复谷歌日历活动,活动组织者/创建者就会收到来自谷歌的电子邮件。我想收到仅创建/更新事件的电子邮件通知。我添加了notification_settings并将event_response方法保留为空白,但它不起作用。
CALENDAR_ID = 'primary'
CALENDAR_NOTIFIER = 'externalOnly'
gcal_event = client.insert_event(
CALENDAR_ID,
Google::Apis::CalendarV3::Event.new(gcal_event_params(gcal_event_attendees)),
send_updates: CALENDAR_NOTIFIER
)
-----------------------
// added notification_settings later so that the organizer should not receive event response, but no luck so far.
def gcal_event_params(gcal_event_attendees)
{
summary: event.name,
description: event.description,
location: event.location,
start: { date_time: event.start.to_datetime.to_s, time_zone: org_timezone },
end: { date_time: event.ends.to_datetime.to_s, time_zone: org_timezone },
attendees: gcal_event_attendees,
reminders: { use_default: true },
notification_settings: {
notifications: [
{type: 'event_creation', method: 'email'},
{type: 'event_change', method: 'email'},
{type: 'event_cancellation', method: 'email'},
{type: 'event_response', method: ''}
]
} }
end