Google日历API(Python)send_event_notifications未发送邮件

1 投票
1 回答
740 浏览
提问于 2025-04-17 00:08

我遇到了一个问题:gdata.calendar.data.CalendarEventEntry.send_event_notifications 这个设置没有起作用(没有发送邮件):

event = gdata.calendar.data.CalendarEventEntry() 
event.title = atom.data.Title(text='test event') 
event.when.append(gdata.calendar.data.When(start=<start date>,end=<end date>)) 
event.who.append(gdata.calendar.data.EventWho(email='gue...@gmail.com',rel='http:// schemas.google.com/g/2005#event.attendee')) 
event.who.append(gdata.calendar.data.EventWho(email='organi...@gmail.com',rel='http:// schemas.google.com/g/2005#event.organizer')) 
event.send_event_notifications = gdata.calendar.data.SendEventNotificationsProperty(value='true') 
new_event = client.InsertEvent(event) 

这段代码能成功把事件添加到组织者的日历里,但客人却没有收到邮件……如果我打印出 new_event,"sendEventNotifications" 这个设置确实显示出来:

<ns0:entry xmlns:ns0="http://www.w3.org/2005/Atom"><ns1:sendEventNotifications value="true" xmlns:ns1="http://schemas.google.com/gCal/2005/" /><ns1:who email="gue...@gmail.com" rel="http://schemas.google.com/g/2005#event.attendee" xmlns:ns1="http://schemas.google.com/g/2005" /><ns1:who email="organi...@gmail.com" rel="http://schemas.google.com/g/2005#event.organizer" xmlns:ns1="http://schemas.google.com/g/2005" /><ns0:title>test event</ns0:title><ns1:when endTime="2011-08-23T10:00:00" startTime="2011-08-23T09:00:00" xmlns:ns1="http://schemas.google.com/g/2005"></ns1:when></ns0:entry> 

有没有人知道这是怎么回事?谢谢!M

1 个回答

1

好的,这里是来自谷歌的Alain发布的解决方案:

在日历的XML命名空间格式中有一个错误,这个问题已经在代码库中修复了:

http://code.google.com/p/gdata-python-client/source/detail?spec=svnff...

请使用代码库中的版本,而不是发布的版本,因为很多修复是在代码库中先推送的:http://code.google.com/p/gdata-python-client/source/checkout

谢谢你,Alain!

撰写回答