在 python 中发送 google 日历事件时发送电子邮件通知
send email notification when send google calendar event in python
我正在使用 google-calendar-api 添加新事件。当我向与会者发送邀请时,活动会添加到他们的日历中,但他们不会收到电子邮件通知:
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': 'lpage@example.com'},
{'email': 'sbrin@example.com'},
],
'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'))
如何添加电子邮件通知?
我尝试添加 sendNotifications: True
和 sendUpdates: 'all'
但它不起作用。
应该跟在...
event = service.events().insert(calendarId='primary', body=event, sendUpdates='all').execute()
我正在使用 google-calendar-api 添加新事件。当我向与会者发送邀请时,活动会添加到他们的日历中,但他们不会收到电子邮件通知:
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': 'lpage@example.com'},
{'email': 'sbrin@example.com'},
],
'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'))
如何添加电子邮件通知?
我尝试添加 sendNotifications: True
和 sendUpdates: 'all'
但它不起作用。
应该跟在...
event = service.events().insert(calendarId='primary', body=event, sendUpdates='all').execute()