Automatically Send Email when Spreadsheet Updates

54 views
Skip to first unread message

Mat

unread,
May 31, 2022, 1:16:38 PM5/31/22
to Google Apps Script Community
Hello,

I have a React website that I have linked to a Google spreadsheet using sheet.best; when someone submits the contact form on the website, the Google spreadsheet is automatically updated.

I would like to send an email to a particular account when this sheet is updated. I have written a script with an on edit trigger (attached below) which currently sends an email when  update the spreadsheet. However, it does not send an email when the sheet is automatically updated from my website. How can I do this? Any help would be appreciated :)

Thank you for your time,

Mat

googleScript.png

cbmserv...@gmail.com

unread,
Jun 1, 2022, 11:25:18 PM6/1/22
to google-apps-sc...@googlegroups.com

Hi Mat,

 

Am not familiar with sheet.best so not sure how it enters info into the spreadsheet. However, a few alternatives for something this simple could be used to make this easier for you to trigger the work.

 

Option 1: you can use a Google Form to collect the name/contact info and have it submit info into the spreadsheet. Then on spreadsheet, use the on Form Submit trigger to call your function and send the email.

 

Option 2: Use a webapp that provides an HTML5 form that you can host on your website, that webapp would collect the info, record it in the spreadsheet and call the trigger function automatically everytime someone submits a contact information.

 

Option 3, if you want to stay on sheet.best, you may have to do a time based trigger which wakes up every hour to check to see if any new contact information was submitted and then send the appropriate email.

 

Easiest method would be option 1, but the Google Forms are not the most appealing, Option 2 is quite flexible but the most work. Option 3 would be simple programming but not real time.

 

Up to you!

--
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 on the web visit https://groups.google.com/d/msgid/google-apps-script-community/e2dbfa49-bc16-4454-a312-54a28001722bn%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages