在这里,使用以下代码,我能够在活动开始前1小时发送通知邮件,我的目标是在添加任何活动或删除活动时将即时邮件发送给提到的参与者。有人可以帮忙吗?
function insertHoliday(auth) {
const calendar = google.calendar({ version: googleCalendarVersion, auth });
calendar.events.insert(
{
auth: auth,
calendarId: calendarID,
resource: {
'summary': name,
'start': {
'dateTime': date + workStartTime,
'timeZone': timeRegion
},
'end': {
'dateTime': date + workEndTime,
'timeZone': timeRegion
},
},
attendees: [{ email: 'menonujra@gmail.com' }],
reminders: {
useDefault: false,
overrides: [{ method: 'email', minutes: 24 * 60 },{ method: 'popup', minutes: 10 }]
}
}, async function (err, res) {
if (err) {
logger.info('There was an error contacting the Calendar service: ' + err);
return;
}
logger.info('Holiday Event Created');
let properties = {
event_id: res.data.id,
}
await holidayModel.updateHolidayById(uuid, properties);
}
);
}