Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #181 #202

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 2 additions & 11 deletions code.gs
Original file line number Diff line number Diff line change
Expand Up @@ -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('#contacts@group.v.calendar.google.com', 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#contacts@group.v.calendar.google.com";

try {
if (Calendar.Calendars.get(settings.user.calendarId) === null) {
Expand Down