Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
616 views
in Technique[技术] by (71.8m points)

javascript - Google Calendar Event Creation send Notifications

I was wondering if anyone knew how to notifiy attendees upon event creation in google calendar. When I create the event manualy, I can send an event as I wish. But when I create the event using the api with the javascript client library. I do not receive email notifications.

Here is my code for creation :

var request = gapi.client.calendar.events.insert({
    'calendarId': '***@***.com',
    'resource': resource
});
request.execute(function() {
});

My resource variable is already defined and the event is added successfuly to the calendar, but no attendees receive any invitations. And if I go into the event on the calendar after creating it, the attendees are there.

Is there anything I am missing in the request to make it so that the attendees receive notifications upon the creation.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

The attendees array has a responseStatus that you can set to: "needsAction" - The attendee has not responded to the invitation. "declined" - The attendee has declined the invitation. "tentative" - The attendee has tentatively accepted the invitation. "accepted" - The attendee has accepted the invitation.

var request = gapi.client.calendar.events.insert({
  'calendarId': '***@***.com',
  'resource': resource,
  'attendees': [{'email':'[email protected]','responseStatus':'needsAction'}]
  }
});
request.execute(function() {
});

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...