Stop Forgetting Birthdays: Build Your Own AI-Powered Notification System with Gemini and Google Sheets
- sheharav
- Dec 2, 2025
- 4 min read
Updated: Dec 10, 2025
We've all been there: a vital birthday slips your mind, or you scramble for a last-minute, generic "HBD" text.
In this guide, I'll walk you through building a free solution using Google Sheets, Google Apps Script, and the Gemini API. We will create a robust automation system that checks for birthdays every morning, generates a unique, context-aware message for each person, and sends a single, consolidated reminder email directly to your inbox.
The System Overview: Your Daily Sentiment Engine
This project, which we'll call the AI-Powered Birthday Notification System, relies on three core components:
Google Sheets (The Data): Where you store the person's name, birthday, and personalized notes (context).
Google Apps Script (The Engine): A JavaScript environment that runs on a schedule, reads your Sheet, and handles the emailing logic.
Gemini API (The Intelligence): Generates a custom, heartfelt message using the context provided in your Sheet.
Phase 1: Data Foundation (Google Sheets)
Your spreadsheet is the brain of the operation, holding all the data necessary to trigger personalized messages.
Step 1: Create and Name Your Sheet
Go to Google Sheets and create a new spreadsheet. Name it Birthday AI Reminder.
Rename the first tab (sheet) to exactly: Birthdays. This name must match the code exactly!
Step 2: Define and Input Your Data
Enter the following column headers in the first row (Row 1) and populate the data.
Column | Header | Example Value | Purpose |
A | Name | Jane Doe | The person's full name. |
B | Birthday (MM/DD) | 11/25 | The month and day (MUST include the leading zero). |
C | Classification | 3 | A number for the relationship category. |
D | Last Sent Year | 2024 | The code manages this! Keeps track of when the last email was sent. |
E | Notes/Context | Loves gardening and has a pet cat named Miso. | Context used by the AI to create a unique message. |
Classification Key (Column C) for Message Tone:
1: Close Family
2: Extended Family
3: Close Friends
4: Friends
5: Deceased (Triggers a reflective, gentle message)
Phase 2: Code Integration (Google Apps Script)
We will use Google Apps Script to write the automation engine.
Step 3: Open Apps Script
In your Birthday AI Reminder spreadsheet, go to Extensions > Apps Script.
This opens the code editor. Delete any placeholder text in the Code.gs file.
Step 4: Paste the Complete Code (in attached document)
Copy the entire working script below and paste it into the empty Code.gs file.
Important: Before saving, find the line const RECIPIENT_EMAIL = "CHANGE THIS TO YOUR EMAIL ADDRESS"; (around Line 13) and replace the placeholder with your actual email address.
Phase 3: Configuration (API Key & Authorization)
This phase connects your script to the Gemini AI model.
Step 5: Get Your Gemini API Key
Go to Google AI Studio (search for "Gemini API key").
Follow the prompts to select or create a Google Cloud Project to house your key.
Click the button to "Create API key."
Copy the entire key string immediately.
Step 6: Paste the API Key into Script Properties
In your Apps Script editor, go to the Project Settings (gear icon) on the left sidebar.
Scroll down to Script properties and click Add script property.
For Property, enter: GEMINI_API_KEY
For Value, paste the entire key you copied in Step 5.
Click Save script properties.
Step 7: Initial Authorization (Grant Permissions)
The script needs permission to read your sheet, connect to the internet (Gemini API), and send emails.
In the Apps Script editor, select the function sendBirthdayReminders from the dropdown menu at the top.
Click the Run button (triangle icon).
A pop-up will appear asking you to Review permissions. Click it.
Follow the prompts to select your Google account, click Advanced, then Go to [Project Name] (unsafe), and finally Allow all permissions (email, sheet, and external connection).
Phase 4: Launch and Automation (The Daily Trigger)
This final step schedules your app to run every day.
Step 8: Create the Daily Trigger
In the Apps Script editor, select the function createDailyTrigger from the dropdown menu at the top.
Click the Run button.
Once executed, this function sets up the schedule. Your app will now automatically run every day between 7:00 AM and 8:00 AM to check for birthdays and send you a consolidated email with the AI-generated messages!
Troubleshooting & Debugging
If your email arrives but the AI message says "AI message generation failed," this is usually a hidden API configuration issue.
Run the testApiKey function: In the Apps Script editor, switch the function selector to testApiKey and click Run.
Check Logs: Go to Execution Logs and look for API TEST RESULT: SUCCESS!. If it says FAILURE, the issue is the key, billing, or quota.
Final Fix: If the test key works, the issue is often a slight API request structure problem. Since we fixed that, running the script again should resolve it. If the issue persists, carefully verify that your GEMINI_API_KEY in the Script Properties is active and correct.
I hope this guide helps you build your own automated Birthday System, if you are ready to upgrade this to a Birthday Agent - see my next post: https://www.aiwithshehara.com/post/from-automation-to-agent-how-to-upgrade-your-birthday-notifier-with-ai-gift-suggestions



Comments