Daily email reminder.

80 views
Skip to first unread message

Babs Johnson

unread,
Jul 31, 2026, 9:18:21 AM (12 days ago) Jul 31
to Google Apps Script Community
I'm head of IT for an organisation of just over a hundred members and we have every member's name and birthday on Googl;e sheet. 
I would like to get a birthday email reminder to a specific email for member who's birthday is on that day from the google sheet so we can send them birthday wishes.

Amit Kumar

unread,
Jul 31, 2026, 9:28:11 AM (12 days ago) Jul 31
to google-apps-sc...@googlegroups.com
I confirm that you would like to set up birthday email reminders for members based on the data from the Google Sheet. I can assist with the implementation of this feature. Please let me know how you'd like to proceed or if you have any specific requirements in mind.
WhatsApp No is 7210756879 
Please Connect 

On Fri, Jul 31, 2026 at 6:48 PM Babs Johnson <babs.jo...@gmail.com> wrote:
I'm head of IT for an organisation of just over a hundred members and we have every member's name and birthday on Googl;e sheet. 
I would like to get a birthday email reminder to a specific email for member who's birthday is on that day from the google sheet so we can send them birthday wishes.

--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/google-apps-script-community/1dbfda3b-e6f3-470a-9eeb-c352336fffc9n%40googlegroups.com.

Peter Isakson

unread,
Jul 31, 2026, 9:56:52 AM (12 days ago) Jul 31
to Google Apps Script Community
This should be easy, but you will need to use apps script (or perhaps an app or add-in). I'd create a container bound script in the spreadsheet. It will be time triggered, say daily at around 1 am. The script will check each row in the sheet to see if the birthday column is "today", and if so, use the Google email methods to send an email to the person (I assume one column is their email address). You can personalize the message by including their name, for example.

There are efficient ways to do this, such as by getting all the data in the sheet into an array and then using matching methods to find rows that have today as the birthday.

I would use Google AI search or a tool like Claude and ask something like "show me apps script that will send an email to each person in a Google spreadsheet with under 200 rows in a tab where the birthdate column is today. customize the email body so it includes their first and last names from columns in the sheet. use an efficient method such as loading the spreadhsheet data into an array and finding anyone with today as the birthday from the array. the code will be triggered by a daily trigger at 1am." It will give you code that you just have to cusomize with parameters like the sheet ID, tab name, name or position of the relevant colmns, etc.

SMAARTE Group

unread,
Jul 31, 2026, 10:26:41 AM (12 days ago) Jul 31
to google-apps-sc...@googlegroups.com
+1 for a one-shot solution with Gemini, Claude, GPT or your other favorite LLM.  Like this:

Instructions for Implementing the Script

Follow these steps carefully to get the automated reminders working in your Google Sheet.

Step 1: Prepare Your Google Sheet

  1. Open the Google Sheet containing your member data.

  2. Ensure your data is organized clearly.

    • Row 1 must be headers (e.g., "Name", "Birthday").

    • Ensure the column containing the birthdays is actually formatted as dates. You can check this by selecting the column, going to Format > Number > Date.

  3. Note down the exact name of the tab (sheet) at the bottom (e.g., "Sheet1", "Members", "Birthdays").

  4. Note down which column has names and which has birthdays. (Column A is 0, Column B is 1, Column C is 2, etc.)

Step 2: Add the Script

  1. In your Google Sheet menu, click on Extensions > Apps Script. This will open a new tab with the Apps Script editor.

  2. You will see a default file named Code.gs with an empty myFunction(). Delete all the code in that window.

  3. Copy all the code from the block I generated above and paste it into the Code.gs editor.

Step 3: Configure the Script

In the code you just pasted, look at the first few lines under // Configuration Variables. You must change these to match your setup:

  1. const SHEET_NAME = 'Birthdays'; -> Change 'Birthdays' to the exact name of your sheet tab (keep the single quotes).

  2. const NAME_COLUMN_INDEX = 0; -> Change 0 if your names are not in Column A (e.g., if names are in Col C, make it 2).

  3. const BIRTHDAY_COLUMN_INDEX = 1; -> Change 1 if your dates are not in Column B.

  4. const EMAIL_RECIPIENT = 'your_i...@example.com'; -> Change this to the specific email address where you want the daily reminders sent.

Step 4: Save and Test the Script

  1. Click the Save icon (floppy disk) in the toolbar or press Ctrl + S (or Cmd + S).

  2. To test it, ensure you have at least one test row in your sheet with today's date as the birthday.

  3. In the toolbar at the top, select checkBirthdaysAndSendReminders from the dropdown menu (it's next to the "Debug" button).

  4. Click the Run button.

  5. Authorization: The first time you run this, Google will ask for permission.

    • Click Review permissions.

    • Select your Google account.

    • You will see a warning saying "Google hasn’t verified this app". Click Advanced.

    • Click Go to Untitled project (unsafe) (or whatever you named the project).

    • Click Allow.

  6. Check the email inbox of the address you configured. You should receive a test reminder.

  7. If you don't get an email, look at the "Execution Log" at the bottom of the Apps Script window for any error messages.

Step 5: Set Up the Daily Trigger (Automation)

To make this happen automatically every day, you need to set up a Trigger.

  1. In the Apps Script editor, look at the left-hand menu sidebar. Click on the Triggers icon (it looks like a small alarm clock).

  2. Click the blue + Add Trigger button in the bottom right corner.

  3. Set up the trigger with these exact settings:

    • Choose which function to run: checkBirthdaysAndSendReminders

    • Choose which deployment should run: Head

    • Select event source: Time-driven

    • Select type of time based trigger: Day timer

    • Select time of day: Choose a time window (e.g., 8am to 9am) when you want the email to be sent every morning.

  4. Click Save.

That's it! Your Google Sheet is now configured to check for birthdays every morning and send an automated email alert to the IT team.


// Configuration Variables
// Replace these with your actual details
const SHEET_NAME = 'Birthdays'; // The exact name of the tab containing the data
const NAME_COLUMN_INDEX = 0; // 0 is Column A, 1 is Column B, etc.
const BIRTHDAY_COLUMN_INDEX = 1; // 0 is Column A, 1 is Column B, etc.
const EMAIL_RECIPIENT = 'your_i...@example.com'; // The email address to send the reminders to
const EMAIL_SENDER_NAME = 'IT Automated Reminders'; // The name that will appear as the sender

/**
 * Main function to check for today's birthdays and send an email reminder.
 * This function should be triggered daily.
 */
function checkBirthdaysAndSendReminders() {
  const sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName(SHEET_NAME);
 
  if (!sheet) {
    Logger.log(`Error: Sheet named "${SHEET_NAME}" not found.`);
    return;
  }

  // Get all data in the sheet (excluding the header row assuming row 1 is headers)
  const dataRange = sheet.getDataRange();
  // We use getValues() to get a 2D array of the data
  const data = dataRange.getValues();
 
  // If the sheet only has headers, stop execution
  if (data.length <= 1) {
    Logger.log("Sheet appears to be empty or only contains headers.");
    return;
  }

  // Get today's date
  const today = new Date();
  const currentMonth = today.getMonth(); // 0-indexed (Jan = 0, Dec = 11)
  const currentDay = today.getDate();

  const birthdaysToday = [];

  // Loop through the data, starting from index 1 to skip the header row
  for (let i = 1; i < data.length; i++) {
    const row = data[i];
    const name = row[NAME_COLUMN_INDEX];
    const birthdayRaw = row[BIRTHDAY_COLUMN_INDEX];

    // Check if the birthday cell is actually a date object
    if (birthdayRaw && birthdayRaw instanceof Date) {
      const bMonth = birthdayRaw.getMonth();
      const bDay = birthdayRaw.getDate();

      // If the month and day match today, add them to the list
      if (bMonth === currentMonth && bDay === currentDay) {
        birthdaysToday.push(name);
      }
    } else if (birthdayRaw) {
        // Log a warning if a cell has data but isn't recognized as a date
        Logger.log(`Warning: Row ${i + 1} has a birthday value that is not recognized as a valid Date object. Value: ${birthdayRaw}`);
    }
  }

  // If we found any birthdays today, send the email
  if (birthdaysToday.length > 0) {
    sendReminderEmail(birthdaysToday);
    Logger.log(`Successfully found and sent reminders for ${birthdaysToday.length} birthdays today.`);
  } else {
    Logger.log("No birthdays found for today.");
  }
}

/**
 * Helper function to format and send the email.
 * @param {string[]} names - Array of names having a birthday today.
 */
function sendReminderEmail(names) {
  const subject = `Birthday Reminder: ${names.length} member(s) have birthdays today!`;
 
  // Create an HTML formatted body for a nicer looking email
  let htmlBody = `
    <div style="font-family: Arial, sans-serif; color: #333; line-height: 1.6;">
      <h2 style="color: #2c3e50;">Daily Birthday Reminder</h2>
      <p>Hello IT Team,</p>
      <p>The following members have birthdays today. Please arrange to send them birthday wishes:</p>
      <ul style="background-color: #f9f9f9; padding: 15px 15px 15px 40px; border-radius: 5px; border-left: 4px solid #3498db;">
  `;

  // Add each name as a list item
  names.forEach(name => {
    htmlBody += `<li style="margin-bottom: 5px; font-weight: bold;">${name}</li>`;
  });

  htmlBody += `
      </ul>
      <p style="margin-top: 20px; font-size: 0.9em; color: #7f8c8d;">This is an automated message generated from the Member Database Google Sheet.</p>
    </div>
  `;

  // Fallback plain text version for email clients that don't support HTML
  let plainBody = "Daily Birthday Reminder\n\n";
  plainBody += "The following members have birthdays today:\n\n";
  names.forEach(name => {
    plainBody += `- ${name}\n`;
  });
  plainBody += "\nThis is an automated message.";

  // Send the email using the MailApp service
  MailApp.sendEmail({
    to: EMAIL_RECIPIENT,
    subject: subject,
    body: plainBody, // Plain text fallback
    htmlBody: htmlBody, // HTML version
    name: EMAIL_SENDER_NAME
  });
}


Regards,
Steve Horvath



--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.

Babs Johnson

unread,
Jul 31, 2026, 9:11:21 PM (11 days ago) Jul 31
to Google Apps Script Community
Thank you so much for this advice, this is more that just a tutorial and easy to follow.
I'm going to try this using the instructions above.

Babs Johnson

unread,
Jul 31, 2026, 9:11:38 PM (11 days ago) Jul 31
to Google Apps Script Community
Hello Peter,
This method is exactly what I'm looking for. Both of the methods you mentioned is what I was intending to implement after watching some tutorials on YouTube.
I will try Claude to see what it would generate fo me, thanks for your input.

Reply all
Reply to author
Forward
0 new messages