I have a script running in a Google Spreadsheet that successfully can create new events; including inviting people with a non-Google account.
Another script can update an existing event. It nicely can reschedule the event, change location, adds/removes attendees.
However, attendees not having a Google account, don't get a notification/update.
When I manually change an event in Google Calendar, I'm asked if I want to notify people. If I press OK, all attendees, are informed, including non-Google accounts.
How to trigger this by script?
The script below runs correctly.
function sendInvite(calendarId, eventId, email) {
var n = eventId.indexOf("@")
var str = eventId.substring(0,n)
var event = Calendar.Events.get(calendarId, str);
if(event.attendees) {
event.attendees.push({
email: email
});
} else {
event.attendees = new Array({email: email});
}
if(email[0].length > 0) {
event = Calendar.Events.patch(event, calendarId, str, {
sendNotifications: true
});
}
}