Reputation: 8653
I have the following code
let calendar = google.calendar({
version: "v3",
auth: oauth2Client,
});
let resource = {
summary: process.env.SITE_NAME + " 1-1 Session",
location: options.comments,
description: "";
start: {
dateTime: new Date(options.startDate),
timeZone: "utc",
},
end: {
dateTime: new Date(options.endDate),
timeZone: "utc",
},
attendees: [
{
email: options.user.email,
},
{
email: options.mentor.email,
},
],
reminders: {
useDefault: false,
overrides: [
{
method: "email",
minutes: 15,
},
{
method: "email",
minutes: 60,
},
{
method: "popup",
minutes: 10,
},
]
},
colorId: 4,
sendUpdates: "all",
status: "confirmed",
};
I want to send a google notification to attendees when they book an appointment. How can I do so using the code above?
Upvotes: 0
Views: 734
Reputation: 201358
I believe your goal is as follows.
In this case, how about the following sample script?
In this case, I think that resource
is not required to be modified. Please modify the script for requesting Calendar API as follows.
calendar.events.insert({
calendarId,
resource,
sendNotifications: true, // <--- Please add this.
})
.then(({ data }) => console.log(data))
.catch(({ errors }) => console.log(errors));
Upvotes: 1