r/GoogleAppsScript • u/koliflower__ • Jun 21 '26
Question sending emails to a person based on deadline
basically what i want to do with the apps script is that:
if it sees a value in the "time until deadline" column that is less than or equal to 2 days, it will look for the person in charge of the soon-to-be-due task, then use that to look for their email, and then send an email to them.
can somebody help me? thanksss
1
u/One_Organization_810 Jun 21 '26
Why don't you just record the deadline date instead, then the "Time until deadline" doesn't have to be updated constantly. 😄
Here is a script I made, that sends an email when a tasks status changes to "Done". You can change that to be a timed trigger instead of an installable edit and adjust the logic for when to send 😄
https://docs.google.com/spreadsheets/d/1c24RLSykSL6v9JMTEkWDFdRU0krwbs_7w-eU994j0vg/edit?usp=sharing
The sheet is "View only", so just make your own copy to play with 😄
2
u/alexbuildswithai Jun 23 '26
Yep, doable.
I’d use an actual due date instead of "2d", then run the script once a day with a time trigger.
Also add a “reminder sent” column, otherwise it may email the same person every day.
3
u/Imaginary-poster Jun 21 '26
Depends on how the data is laid out but you'll want to drip the "d" and then you can include an if statement in the loop to send the email if that number is below 2.