0

I added the feature of syncing google calendar with events of my application. But the issue was, the event organizer/creator was receiving emails from google whenever the event attendee responds to the google calendar event. I wanted to receive the email notification for only creation/updation of events. I added the notification_settings and kept event_response method to blank but it didn't work.

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
hasanadeem
  • 69
  • 9

1 Answers1

1

Answer:

The notification settings for event creation, change, cancellation and response are settings of the Calendar itself, not the individual events of the Calendar. The notification_settings parameter of Events: insert does not exist, which is why this is not working.

More Information:

I'm not really sure where the writer of the blog that you linked is getting the information, but the Events: insert method of the Calendar API does not have this parameter.

In the user interface at calendar.google.com, you can see the notification settings you are referring to in the settings page for the whole calendar, not for individual events:

enter image description here

For individual events, when the event is created, you can use the sendUpdates parameter to specify who, if anyone, should be notified when the event is created. The same parameter exists as a part of the Events: update method, which lets you set who gets notified of that specific change.

If you want to have notifications set up for the creation, changing and cancellation of events, but not of event responses, then this needs to be set up for the Calendar itself. Unfortunately however, this isn't something that can be done with the API and needs to be set in the User Interface itself.

This does unfortunately mean that what you're looking at doing isn't something that is possible through the Calendar API.

Feature Request:

If this is of interest to you, you can however let Google know that this is a feature that is important for the Calendar API and that you would like to request they implement it. Google's Issue Tracker is a place for developers to report issues and make feature requests for their development services. The page to file a Feature Request for the Calendar API is here.

References:

Nimantha
  • 6,405
  • 6
  • 28
  • 69
Rafa Guillermo
  • 14,474
  • 3
  • 18
  • 54