Send Birthday Email Reminders using Google Sheets & Apps Script

Send Automatic Birthday Reminders using Google Sheets & Google Apps Script

This tutorial shows you how to use Google Sheets and Apps Script to send automatic email reminders for birthdays — be it for friends, family, or office colleagues. A scheduled trigger will run daily and send beautiful HTML emails when a birthday matches today's date!

๐Ÿ“‹ Step 1: Setup Google Sheet

Create a new Google Sheet and name it Birthday Reminder Tracker. Use the following structure:

ColumnDetails
Sr No1
NameJane Doe
Birthday1995-06-28
Emailjanedoe@email.com
Reminder Time (HH:MM)09:00
Last Sent(empty)
Reminder Time: This lets you define when to send the mail (in 24-hour format like 08:30 or 17:45).
Last Sent: This column will be updated automatically to avoid duplicate mails.

๐Ÿ’ป Step 2: Add Google Apps Script

  1. Click Extensions → Apps Script
  2. Clear any default code
  3. Paste the script below ๐Ÿ‘‡
function sendBirthdayReminders() {
  const sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Birthdays");
  const data = sheet.getDataRange().getValues();
  const today = new Date();
  const currentTime = Utilities.formatDate(today, Session.getScriptTimeZone(), "HH:mm");
  const todayStr = Utilities.formatDate(today, Session.getScriptTimeZone(), "yyyy-MM-dd");

  for (let i = 1; i < data.length; i++) {
    const name = data[i][1];  // Column B
    const dob = new Date(data[i][2]);  // Column C
    const email = data[i][3];  // Column D
    const reminderTime = data[i][4];  // Column E
    const lastSent = data[i][5];  // Column F

    const birthDay = dob.getDate();
    const birthMonth = dob.getMonth();

    Logger.log(`Row ${i + 1} - Name: ${name}, Birthday: ${dob}, Email: ${email}`);
    Logger.log(`Today: ${todayStr}, ReminderTime: ${reminderTime}, CurrentTime: ${currentTime}, LastSent: ${lastSent}`);

    if (today.getDate() === birthDay && today.getMonth() === birthMonth) {
      Logger.log(`${name}'s birthday is today.`);
      if (currentTime === reminderTime && lastSent !== todayStr) {
        Logger.log(`Time matched & not already sent. Sending email to ${email}`);

        const subject = "๐ŸŽ‚ Happy Birthday: " + name;
        const message =`
  

๐ŸŽ‰ Happy Birthday, ${name}!

We just wanted to let you know that today is a special day — it's your birthday! ๐ŸŽ‚

Wishing you a day filled with love, laughter, and wonderful memories ๐Ÿฅณ

Warm wishes,
๐ŸŽˆ Your Awesome Reminder System

`; MailApp.sendEmail({ to: email, subject: subject, htmlBody: message }); sheet.getRange(i + 1, 6).setValue(todayStr); // Update Last Sent } else { Logger.log(`Not sending: Either time doesn't match or already sent.`); } } else { Logger.log(`${name}'s birthday is not today.`); } } }

⏰ Step 3: Set a Daily Trigger

  1. Go to Apps Script → Triggers (⏰ icon on left)
  2. Click + Add Trigger
  3. Choose sendBirthdayReminders function
  4. Set event type as Time-driven
  5. Choose "Every hour"
The script runs every hour and checks if the current time matches the time in your "Reminder Time" column. That way, it sends only once per person per day!

๐ŸŽจ Sample Email Preview

๐ŸŽ‰ Happy Birthday Jane Doe!

We just wanted to let you know that today is a special day — it's your birthday! ๐ŸŽ‚

Wishing you a day filled with love, laughter, and wonderful memories ๐Ÿฅณ

Warm wishes,
๐ŸŽˆ Your Awesome Reminder System

๐Ÿš€ Final Words

This system can be a great personal assistant — reminding you of birthdays of colleagues, clients, friends or family.

Next up, we’ll add Google Calendar integration and Slack/WhatsApp alerts. Stay tuned!

Found this useful? Share it with others and explore more automation tutorials on our blog!

๐Ÿ“บ Watch Tutorial: Scripted Success Master on YouTube
๐Ÿ“– Visit Blog: scriptedsuccessmaster.blogspot.com

Comments

Popular posts from this blog