我正在通过以下代码使用服务帐户和Node.js Google API客户端库在组织日历上创建事件:
var event =
{
summary: meeting.title,
description: meeting.agenda,
start:
{
dateTime: meeting.startTime,
timeZone: "Africa/Johannesburg"
},
end:
{
dateTime: meeting.endTime,
timeZone: "Africa/Johannesburg",
},
attendees:
[
{ email: meeting.hostEmail, displayName: meeting.hostName },
{ email: meeting.clientEmail, displayName: meeting.clientName }
]
};
var entry =
{
auth: auth,
calendarId: meeting.hostCalendarId,
sendUpdates: "all",
sendNotifications: true,
resource: event
}
calendar.events.insert(entry, function(err, event)
{
if (err)
{
console.log('There was an error contacting the Calendar service: ' + err);
response.sendStatus(500);
return;
}
response.sendStatus(200);
});
根据我的理解,创建事件时应该触发向所有与会者发送电子邮件通知的参数是sendUpdates: "all"
参数。
可以很好地创建活动,为所有与会者创建日历上的条目,但是,不会发送电子邮件通知来告诉与会者该活动已创建。
有人知道为什么这行不通吗?