다음 코드가 있는데 참석자들이 이벤트에 대한 이메일을받을 수 없습니다 . 이벤트가 달력에 반영되지만.
var options = {
description: description,
location: location,
guests: email_address,
sendInvites: true
}
var event = CalendarApp.getCalendarById(calendarId).createEvent(title,
start_datetime, end_datetime,
options);
oauthScopes도 appsscript.json에 추가했습니다.
"oauthScopes": [
"https://www.googleapis.com/auth/calendar",
"https://www.google.com/calendar/feeds"
]
인증 문제로 보이지만 해결 방법을 잘 모르겠습니다.
브라우저 편집기에서 스크립트를 실행하는 동안 수동으로 범위를 추가 할 필요가 없습니다.
귀하의 코드는 나를 위해 완벽하게 작동했습니다. :) 몇 가지 변수를 추가하여 완료했지만 제대로 작동했습니다.
function myFunction() {
var calendarId = '[email protected]'; // if using your own or default calendar ID
var description = 'test desc';
// ref link - https://developers.google.com/apps-script/reference/calendar/calendar-app#advanced-parameters_4
var email_address = '[email protected], [email protected]';
// comma separated guest list
var title = 'test title';
var start_datetime = new Date();
var end_datetime = new Date();
var options = {
description: description,
guests: email_address,
sendInvites: true
}
var event = CalendarApp
.getCalendarById(calendarId)
.createEvent(title, start_datetime, end_datetime, options);
}
내 기본 매니페스트 파일은 다음과 같습니다.
{
"timeZone": "Asia/Kolkata",
"dependencies": {
},
"exceptionLogging": "STACKDRIVER"
}
추가 범위가 추가되지 않은 것 같습니다. 그러나 File> Project properties> Scope를 볼 때 스크립트에 의해 단일 범위 만 추가 된 것 같습니다.
OAuth Scope required by script:
https://www.googleapis.com/auth/calendar
도움이 되었기를 바랍니다.
메모 수정 : 추가하는 것을 잊음-
이메일 알림도 받고 있습니다.
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다