0
Google 스크립트 또는 Google 캘린더 API를 사용하여 이미 생성 된 일정에 손님을 초대하는 방법을 결정하려고합니다. addGuest (전자 메일)를 사용하면 이벤트가 생성 된 후 게스트를 추가 할 때 전자 메일 초대장을 보내지 않습니다.Google 캘린더 API가 기존 이벤트에 초대
이 문제는 어떻게 해결 될까요?
var calid = 'some CalendarID';
var eventid = 'some eventid';
var ss = SpreadsheetApp.getActiveSpreadsheet();
var column = ss.getRange('A2:A2');
var emails = column.getValues();
var createdEvent = Calendar.Events.update(calid, eventid).attendees(emails);
나는 또한 보았지만 작동하지 않습니다.
function sendInvite(calendarId, eventId, emails) {
var event = Calendar.Events.get(calendarId, eventId);
event.attendees.push({email: emails});
event = Calendar.Events.patch(event, calendarId, eventId, {
sendNotifications: true
});
}
그리고이 하나
function sendInvite(calendarId, eventId, email) {
var event = Calendar.Events.get(calendarId, eventId);
if(event.attendees) {
event.attendees.push({
email: email
});
} else {
event.attendees = new Array({email: email});
}
event = Calendar.Events.patch(event, calendarId, eventId, {
sendNotifications: true
});
}
이 스크립트는 고급 캘린더 API를 사용합니다. 시도하기 전에 API에 권한을 부여 했습니까? ressource 메뉴와 Google API 콘솔 모두에서 수행해야합니다. –
예 전적으로 승인했습니다. API로 생성 된 이벤트를 가져올 수 있습니다. 다른 이메일 캘린더에 이벤트가 추가 된 것을보고 사용자가 예, 아니요 또는 어쩌면 클릭하기를 기다리고 있습니다. 그러나 그것은 사람에게 초대 할 전자 메일을 생성하지 않습니다. 제가 고심하고있는 이메일입니다. API로 보내려면 어떻게해야합니까? 또는 어떻게 다시 만들 수 있습니까? –