🎉 th23 Google Birthday Calendar
Automatic syncing of Google Contacts birthdays as event series with reminders to Google Calendar
🚀 Introduction
Due to some regulatory requirements (?) birthdays added to your Google Contacts are not shown in the Google Calendar, even if you activate Sync birthdays. You are left with the options to manually create a birthday series for every contact and keep this updated in case of any changes or you run the risk to miss birthdays of your contacts.
th23 Google Birthday Calendar uses Google Apps Script to create and sync an event series for every contacts birthday.
- Get a remider in the Google Calendar for birthdays of your contacts
- Maintain your contacts birthdays in one place together with other key info in Google Contacts
- Automate any updates by the once a day sync running in the background - only notifying you about any issues or giving a sign of life once in a while via mail
⚙️ Setup
A) Code and Resources
- Open https://script.google.com in your browser
- Create
New projectand change its title toBirthday Calendar - Open the
code.gsfile from Github repository, mark everything and copy to clipboard - Back to the Apps Script window in your browser, ensure you are in
code.gsfile, where you might see only an emptyfunction myFunction() - Mark everything and replace it by pasting the copied code from the cllipboard
- On the left pane click the
+button next toServices, scroll down and selectPeopleapi, clickAddat the bottom right - On the left pane click the
+button next toServices, scroll down and selectGoogle Calendar API, clickAddat the bottom right - Click
Save project to Drivebutton
B) Configuration and Permissions
- Adjust configuration via the const... lines in the
=== CONFIGURATION ===secion (see comments above each setting) - For a test set
const debug = truein the configuration to get more information about the progress via updates in the console - Once done, hit the
Runbutton to try it - and grant required permissions - A popup will indicate
Authorization required: This project requires your permission to access your data. - Click
Review Permissionsand select your Google account, that contains your contacts and calendar to sync - You will get the warning, that
Google hasn’t verified this app, but you can either trust me or review the source code, to be safe that there are no "funny" things included! - Click
Advancedat the bottom left to continue and clickGo to Birthday Calendar (unsafe) - Sign in by selecting your Goolge account (again) and clicking
Continueto allow required permissions:- Allow access to your mails - used for authentication and infos via mail in case of any errors
- Allow access to your contacts - used to read all contacts and filter the ones with a birthday given
- Allow access to your calendar - used to create / modify birthday events / series
- You will receive an email with recently granted permissions as a "Security alert", follow the included link to indicate "Yes, it was me"
C) Automation
- If everything worked well, you should revert the debug config to false (see above) add a regular time-based trigger
- Navigate to
Triggersin the pane on the left. ClickAdd Triggeron the bottom right - In the following window to add a trigger ensure the following settings:
- Function to run
update_birthdays - Deployment to run
Head - Event source
Time-driven - Time based trigger
Day timer - Time of day
10pm to 11pm - Failure notification - leave at default
- Function to run
- Scroll down and hit
Save
[!IMPORTANT] Google defines a hard limit of max 6min execution time for a script - dealing with the limit this script stops execution after 5:30min and continues its job on the next run ie on following day where it stopped before
You will get a notification via mail in case this happens
[!NOTE] Once a month you get a "sign of life" via mail from this script - just so you know everything is working in the background as planned
🖐️ Usage
Just keep using your Google Contacts and Calendar as you did before - adding your contacts date of birth directly in the contact - and get reminded of all of your contacts birthdays with a calendar notification.
🤝 Contributors
Feel free to raise issues or contribute code for improvements via GitHub.
©️ License
You are free to use this code in your projects as per the GNU General Public License v3.0. References to this repository are of course very welcome in return for my work 😉