# Auto birthday emails

**URL:** <https://community.glideapps.com/t/auto-birthday-emails/70881>\
**Category:** Ask for Help\
**Created:** [February 16, 2024, 11:55am UTC](https://community.glideapps.com/t/auto-birthday-emails/70881 "2024-02-16T11:55:40Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Benjamin\_Strickland](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/benjamin_strickland/32/68255_2.png) [@Benjamin\_Strickland](https://community.glideapps.com/u/Benjamin_Strickland)\
**Post date:** [February 16, 2024, 11:55am UTC](https://community.glideapps.com/t/auto-birthday-emails/70881/1 "2024-02-16T11:55:40Z")

</div>

Is there a special feature or integration in Glide to trigger an email or SMS for a birthday or anything else? If so, how is it done? Thanks

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [February 16, 2024, 12:32pm UTC](https://community.glideapps.com/t/auto-birthday-emails/70881/2 "2024-02-16T12:32:53Z")

</div>

There is not an easy way to trigger a notification, as that would require that the user be signed in to the App and click on a button or similar.

However, you could detect if today is a users birthday, and present a birthday greeting in the App.

Assuming that you have the users date of birth in your users table, do it as follows:

- Create two math columns using the following formula:

```auto
Month(Date)*100+Day(Date)

```

- The first math column should use the special `Now` value as a replacement
- The second column should use the column that contains each users date of birth as a replacement
- If the two math columns return the same number for any user, that means today is their birthday. So you can use that.
- Add a component with your birthday greeting to any screen, and configure the visibility condition as follows:  
– User Profle-\>1st Math column equals User Profile-\>2nd Math column

---

<div class="post-metadata">

**Author:** ![Benjamin\_Strickland](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/benjamin_strickland/32/68255_2.png) [@Benjamin\_Strickland](https://community.glideapps.com/u/Benjamin_Strickland)\
**Post date:** [February 16, 2024, 1:23pm UTC](https://community.glideapps.com/t/auto-birthday-emails/70881/3 "2024-02-16T13:23:47Z")

</div>

Thank you, but can this be set up to automatically send an email or text?

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [February 16, 2024, 1:37pm UTC](https://community.glideapps.com/t/auto-birthday-emails/70881/4 "2024-02-16T13:37:11Z")

</div>

As I said, not easily.

It could be done if you have a plan that includes access to the Glide API.  
It could also be done if you are using an external data source such as Google Sheets.

---

<div class="post-metadata">

**Author:** ![Benjamin\_Strickland](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/benjamin_strickland/32/68255_2.png) [@Benjamin\_Strickland](https://community.glideapps.com/u/Benjamin_Strickland)\
**Post date:** [February 16, 2024, 3:39pm UTC](https://community.glideapps.com/t/auto-birthday-emails/70881/5 "2024-02-16T15:39:23Z")

</div>

I am using the Google Sheets with this application.

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [February 16, 2024, 3:50pm UTC](https://community.glideapps.com/t/auto-birthday-emails/70881/6 "2024-02-16T15:50:40Z")

</div>

Okay, so that means that it is possible. But it still doesn’t mean that it is easy.

Two possible options:

- The no-code option: use an automation tool such as Zapier or Make to scan the data in your Google Sheet once a day, look for user bithday dates that match the current date, and then send an email to each one found.
- The code option: do the same as above, but using Apps Script.

---

<div class="post-metadata">

**Author:** ![Benjamin\_Strickland](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/benjamin_strickland/32/68255_2.png) [@Benjamin\_Strickland](https://community.glideapps.com/u/Benjamin_Strickland)\
**Post date:** [February 16, 2024, 5:47pm UTC](https://community.glideapps.com/t/auto-birthday-emails/70881/7 "2024-02-16T17:47:04Z")

</div>

I will have to research this a little more since there are no examples of it. Thanks.

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [February 16, 2024, 6:39pm UTC](https://community.glideapps.com/t/auto-birthday-emails/70881/8 "2024-02-16T18:39:06Z")

</div>

ChatGPT can be your friend as far as having it come up with a script for you for google app scripts.

---

<div class="post-metadata">

**Author:** ![Benjamin\_Strickland](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/benjamin_strickland/32/68255_2.png) [@Benjamin\_Strickland](https://community.glideapps.com/u/Benjamin_Strickland)\
**Post date:** [February 16, 2024, 7:34pm UTC](https://community.glideapps.com/t/auto-birthday-emails/70881/9 "2024-02-16T19:34:08Z")

</div>

I will try that. Thanks

---

<div class="post-metadata">

**Author:** ![Benjamin\_Strickland](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/benjamin_strickland/32/68255_2.png) [@Benjamin\_Strickland](https://community.glideapps.com/u/Benjamin_Strickland)\
**Post date:** [February 16, 2024, 8:16pm UTC](https://community.glideapps.com/t/auto-birthday-emails/70881/10 "2024-02-16T20:16:20Z")

</div>

Will I need the business plan to run a Java Script Action?

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [February 16, 2024, 8:20pm UTC](https://community.glideapps.com/t/auto-birthday-emails/70881/11 "2024-02-16T20:20:13Z")

</div>

Google App Scripts have nothing to do with Glide plans. That’s all in google, and it’s included for free. I use google app scripts to handle various things in my back end data outside of Glide.

And besides, the javascript column is included on all glide plans, but that’s not we are talking about here.

---

<div class="post-metadata">

**Author:** ![Benjamin\_Strickland](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/benjamin_strickland/32/68255_2.png) [@Benjamin\_Strickland](https://community.glideapps.com/u/Benjamin_Strickland)\
**Post date:** [February 16, 2024, 8:35pm UTC](https://community.glideapps.com/t/auto-birthday-emails/70881/12 "2024-02-16T20:35:10Z")

</div>

I have created the birthday function in my google sheet, but where do I place an action to trigger it to run in Glide?

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [February 16, 2024, 8:44pm UTC](https://community.glideapps.com/t/auto-birthday-emails/70881/13 "2024-02-16T20:44:14Z")

</div>

You don’t do anything in Glide. With Google App Scripts, you set up an automated script that either runs based on any data changing in a table, or you can set it up to run automatically during a certain time of day.

For example, I have a google app script that runs weekly and creates a backup of my entire google sheet. Another automated script I have is to archive and delete old rows in a couple of my tables. This script runs once a day. These scripts have no association with Glide. They just act on the data in my google sheet.

You should be able to set up your triggers in the Google App Script interface.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/4/1/41cd64110f556b5a1320fb6da371943f52ddc0b7.png)

---

<div class="post-metadata">

**Author:** ![Benjamin\_Strickland](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/benjamin_strickland/32/68255_2.png) [@Benjamin\_Strickland](https://community.glideapps.com/u/Benjamin_Strickland)\
**Post date:** [February 16, 2024, 9:47pm UTC](https://community.glideapps.com/t/auto-birthday-emails/70881/14 "2024-02-16T21:47:38Z")

</div>

I this setup in Google Sheets but will it automatically run in Glide with the other math columns you suggested in glide?

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [February 16, 2024, 10:06pm UTC](https://community.glideapps.com/t/auto-birthday-emails/70881/15 "2024-02-16T22:06:44Z")

</div>

Google App Scripts have absolutely nothing to do with Glide. They act on the data that’s available in your google sheets. Assuming you have a Date column, your script should be able to determine who has a birthday or not.

The script would be sending the emails. Not Glide.

---

<div class="post-metadata">

**Author:** ![Himaladin](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/himaladin/32/71023_2.png) [@Himaladin](https://community.glideapps.com/u/Himaladin)\
**Post date:** [February 17, 2024, 12:08am UTC](https://community.glideapps.com/t/auto-birthday-emails/70881/16 "2024-02-17T00:08:38Z")

</div>

This video is only an introduction, it needs to be adjusted to suit your needs. Using chat Gpt will help a lot after you watch this video. Hope this helps

[![](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/5/7/576273734122fbfe8e9a6daad344667c77bbc6e1.jpeg "Google Sheets - Send Emails Using Apps Script JavaScript MailApp Tutorial - Part 12") ](https://www.youtube.com/watch?v=ZcNmur6xiX4)

---

<div class="post-metadata">

**Author:** ![Benjamin\_Strickland](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/benjamin_strickland/32/68255_2.png) [@Benjamin\_Strickland](https://community.glideapps.com/u/Benjamin_Strickland)\
**Post date:** [February 17, 2024, 2:35am UTC](https://community.glideapps.com/t/auto-birthday-emails/70881/17 "2024-02-17T02:35:41Z")

</div>

Below is my birthday script but it is not sending an email. However, it does run. What is wrong with it.

function sendBirthdayWishes() {  
var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();  
var data = sheet.getDataRange().getValues();  
var today = new Date();

data.forEach(function(row) {  
var name = row[0];  
var birthday = new Date(row[1]);  
var contactInfo = row[2]; // Email or Phone number

if (birthday.getMonth() === today.getMonth() && birthday.getDate() === today.getDate()) {  
var message = "Happy Birthday, " + name + “!”;  
sendEmailOrSMS(contactInfo, message);  
}  
});  
}

function sendEmailOrSMS(contactInfo, message) {  
// Code to send email or SMS  
// If sending email, you can use GmailApp  
// If sending SMS, you may need to use a third-party service or API  
}  
function sendEmail() {  
var recipient = ‘[bsstrick@comcast.net](mailto:bsstrick@comcast.net)’;  
var subject = ‘Test Email’;  
var body = ‘This is a test email sent from Google Apps Script’;

MailApp.sendEmail(recipient, subject, body);  
}

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [February 17, 2024, 2:47am UTC](https://community.glideapps.com/t/auto-birthday-emails/70881/18 "2024-02-17T02:47:22Z")

</div>

The one obvious thing is that you call a function (`sendEmailOrSMS()`) that doesn’t actually do anything 👇

```auto
function sendEmailOrSMS(contactInfo, message) {
// Code to send email or SMS
// If sending email, you can use GmailApp
// If sending SMS, you may need to use a third-party service or API
}

```

You probably should be calling the `sendEmail()` function instead.

If you are new to Apps Script, the first step in debugging is to add `console.log()` lines at strategic points in the code so you can get the code to log the values of variables at various stages.

A better way (but slightly more advanced) is to use the built in debugger. It allows you to add breakpoints in the code, then run it in debug mode, and step through line by line/function by function.

---

<div class="post-metadata">

**Author:** ![Himaladin](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/himaladin/32/71023_2.png) [@Himaladin](https://community.glideapps.com/u/Himaladin)\
**Post date:** [February 17, 2024, 3:19am UTC](https://community.glideapps.com/t/auto-birthday-emails/70881/19 "2024-02-17T03:19:12Z")

</div>

You’re also using the wrong type of quotation marks around the exclamation mark.  
Please Use Chat GPT to help review your code.

---

<div class="post-metadata">

**Author:** ![Benjamin\_Strickland](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/benjamin_strickland/32/68255_2.png) [@Benjamin\_Strickland](https://community.glideapps.com/u/Benjamin_Strickland)\
**Post date:** [February 17, 2024, 7:20am UTC](https://community.glideapps.com/t/auto-birthday-emails/70881/20 "2024-02-17T07:20:36Z")

</div>

This was produced with Chatgpt.

[Next page](https://community.glideapps.com/t/auto-birthday-emails/70881.md?page=2)
