ron kolel
ron kolel

Reputation: 49

send email notification when send google calendar event in python

I am using google-calendar-api to add a new event. When I send the invitation to the attendees, the event is added to their calendar but they are not get notification to the email:

event = {
  'summary': 'Google I/O 2015',
  'location': '800 Howard St., San Francisco, CA 94103',
  'description': 'A chance to hear more about Google\'s developer products.',
  'start': {
    'dateTime': '2015-05-28T09:00:00-07:00',
    'timeZone': 'America/Los_Angeles',
  },
  'end': {
    'dateTime': '2015-05-28T17:00:00-07:00',
    'timeZone': 'America/Los_Angeles',
  },
  'recurrence': [
    'RRULE:FREQ=DAILY;COUNT=2'
  ],
  'attendees': [
    {'email': '[email protected]'},
    {'email': '[email protected]'},
  ],
  'reminders': {
    'useDefault': False,
    'overrides': [
      {'method': 'email', 'minutes': 24 * 60},
      {'method': 'popup', 'minutes': 10},
    ],
  },
}

event = service.events().insert(calendarId='primary', body=event).execute()
print 'Event created: %s' % (event.get('htmlLink'))

How can I add email notification?

I tried to add sendNotifications: True and sendUpdates: 'all' but it is not work.

Upvotes: 0

Views: 1545

Answers (1)

Vanillaboy
Vanillaboy

Reputation: 412

It should be following ...

event = service.events().insert(calendarId='primary', body=event, sendUpdates='all').execute()

Source: https://developers.google.com/resources/api-libraries/documentation/calendar/v3/python/latest/calendar_v3.events.html#insert

Upvotes: 1

Related Questions