forked from GioBonvi/GoogleContactsEventsNotifier
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Hardcode the calendar ID "addressbook#[email protected]" as suggested by @sbrocket in the issue GioBonvi#181.
- Loading branch information
Showing
1 changed file
with
2 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2184,17 +2184,8 @@ function validateSettings () { | |
log.add('Your user.notificationEmail setting is invalid!', Priority.FATAL_ERROR); | ||
} | ||
|
||
// Get the calendar ID from Google Calendar. | ||
calendarId = CalendarApp.getAllCalendars().filter(function (cal) { | ||
// All the valid calendar IDs contain this string. | ||
return isIn('#[email protected]', cal.getId()); | ||
}).map(function (cal) { return cal.getId(); }); | ||
|
||
if (calendarId.length > 0) { | ||
settings.user.calendarId = calendarId[0]; | ||
} else { | ||
log.add('Could not find the birthday calendar! Please check that you have enabled it!', Priority.FATAL_ERROR); | ||
} | ||
// Hardcode the calendar ID for the address book | ||
settings.user.calendarId = "addressbook#[email protected]"; | ||
|
||
try { | ||
if (Calendar.Calendars.get(settings.user.calendarId) === null) { | ||
|