我正在尝试通过 API 创建一个事件,并且它大部分都在工作,除了在受邀者日历中创建新事件时,没有发送电子邮件。
从 Web 界面创建事件是插入事件通过,以及发送电子邮件(除了一个根本没有收到任何通知的帐户,但这与我当前的问题无关)。
我试图插入的事件是:
<entry xmlns='http://www.w3.org/2005/Atom'
xmlns:gd='http://schemas.google.com/g/2005'>
<category scheme='http://schemas.google.com/g/2005#kind'
term='http://schemas.google.com/g/2005#event'></category>
<title type='text'>test event</title>
<content type='text'>content.</content>
<gd:transparency
value='http://schemas.google.com/g/2005#event.opaque'>
</gd:transparency>
<gd:eventStatus
value='http://schemas.google.com/g/2005#event.confirmed'>
</gd:eventStatus>
<gd:where valueString='somewhere'></gd:where>
<gd:who email="[redacted]" rel='http://schemas.google.com/g/2005#event.attendee' valueString='Me'><gd:attendeeStatus value='http://schemas.google.com/g/2005#event.invited'/></gd:who>
<gd:who email="[redacted again]" rel='http://schemas.google.com/g/2005#event.organizer' valueString='Also Me'><gd:attendeeStatus value='http://schemas.google.com/g/2005#event.accepted'/></gd:who>
<gd:when startTime='2010-05-18T15:30:00.000+10:00'
endTime='2010-05-18T16:00:00.000+10:00'></gd:when>
</entry>
当我请求事件列表时,我看不到通过 API 创建的事件和通过 Web 界面创建的事件之间有任何大的差异。
编辑:身份验证是通过用户名/密码而不是 AuthSub 或 OAuth,但我怀疑这是否相关
最佳答案
根据 Trevor's message in this thread我在追求(记录不佳)gCal:sendEventNotifications
属性(在我的示例中,需要扩展 <entry>
节点以包含 gCal 命名空间,因此示例变为:
<entry xmlns='http://www.w3.org/2005/Atom'
xmlns:gd='http://schemas.google.com/g/2005'
xmlns:gCal='http://schemas.google.com/gCal/2005'>
<category scheme='http://schemas.google.com/g/2005#kind'
term='http://schemas.google.com/g/2005#event'></category>
<title type='text'>test event</title>
<content type='text'>content.</content>
<gd:transparency
value='http://schemas.google.com/g/2005#event.opaque'>
</gd:transparency>
<gd:eventStatus
value='http://schemas.google.com/g/2005#event.confirmed'>
</gd:eventStatus>
<gd:where valueString='somewhere'></gd:where>
<gCal:sendEventNotifications value='true'></gCal:sendEventNotifications>
<gd:who email="[redacted]" rel='http://schemas.google.com/g/2005#event.attendee' valueString='Me'><gd:attendeeStatus value='http://schemas.google.com/g/2005#event.invited'/></gd:who>
<gd:who email="[redacted again]" rel='http://schemas.google.com/g/2005#event.organizer' valueString='Also Me'><gd:attendeeStatus value='http://schemas.google.com/g/2005#event.accepted'/></gd:who>
<gd:when startTime='2010-05-18T15:30:00.000+10:00'
endTime='2010-05-18T16:00:00.000+10:00'></gd:when>
</entry>
关于google-calendar-api - 如何让通过 Google Calendar API 创建的事件发送邀请电子邮件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2846515/