How to send automated emails on Google Forms submission

How to send automated emails on Google Forms submission

Code with Ahsan

2 года назад

50,188 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

Code with Ahsan
Code with Ahsan - 13.06.2022 13:36

If you're facing the error: "Cannot ready property 'namedValues' of undefined", please make sure the column name "Email" in the excel sheet, and the column name "Email Address" in the code are exactly the same. I.e. case sensitive. That should fix the error.

Ответить
Le Anh
Le Anh - 09.11.2023 19:41

Do you have any code for mobile scaling. The mobile version is too small and have too much padding

Ответить
Le Anh
Le Anh - 09.11.2023 16:00

thank you

Ответить
Lizaira Llerena
Lizaira Llerena - 22.10.2023 02:23

I’m getting an error on line 15 e.namedValues; not sure what to do to fix this?

Ответить
Rob V
Rob V - 11.10.2023 22:00

Awesome - This was exactly what I was looking for. I did have 1 small issue. The email address column....the code has this : var email = responses['Email address'][0].trim();
I had to change it to var email = responses['Email Address'][0].trim();
(Email Address - both caps) in order to get it to work. After that change, it works great.
Also - 1 note - the document that you use for email needs to be viewable by anyone with the link.

Saved me a ton of time. Thanks again.

Ответить
Starbloom Dance
Starbloom Dance - 10.10.2023 13:14

Wow, this is really cool. I'm going to use this for everything. I had the error listed at the top but it was a quick fix to change Email Address to Email address in Google Sheets. I also have the Payable Forms Add-on connected and it all integrated beautifully.

Ответить
João Victor Korff
João Victor Korff - 28.09.2023 18:16

Is it possible to customize the template with data from the sheet?

Ответить
Conconnects
Conconnects - 27.09.2023 16:23

Hi, it's me again. Do you have a code that can send a specific email based on a response from the Google form? You are still a genius!!! Also, I was hoping to have heard from you about the timer email that I asked a video for.

Ответить
Izzat Irfan
Izzat Irfan - 29.08.2023 06:56

hI, THE ERROR DESCRIPTION IS LIKE THIS:
TypeError: Cannot read properties of undefined (reading '0')
at onFormSubmit(Code:25:41)

Ответить
Edgar Noe Guerrero Prospero
Edgar Noe Guerrero Prospero - 22.08.2023 19:48

Thank you Ahsan, very grateful for your heart to share your wisdom. I am running into an issue and I was hoping to get some advice when you get the chance. Pretty much, upon form submission I am seeing the execution fail. Encountering this error: "TypeError: Cannot read properties of undefined (reading 'Email address')
at onFormSubmit(code:25:24)" I saw your comments in the script to check the excel sheet to validate the email and I indeed confirmed it is formatted like the script: Email address, however, I continue to see this problem. Any idea?

Ответить
Deep Sagar Verma
Deep Sagar Verma - 20.08.2023 05:54

"Choose which function to run" is not opening. Before that an error message came "You cannot create a trigger without a target function, please add functions to the attached script". What to do now ?

Ответить
Esi Colbert
Esi Colbert - 11.08.2023 20:48

Great video!

How do I fix the Error
Script function not found: onFormSubmit

Ответить
Pete Ballard
Pete Ballard - 09.08.2023 21:45

I'm getting Script function not found: onFormSubmit error - just spins on the trigger page saying it can't find a function.

Ответить
Neha Agarwal
Neha Agarwal - 03.08.2023 13:10

Still after 1 year this helps a lot.Thank you so much

Ответить
Salisu Faruq Opeyemi
Salisu Faruq Opeyemi - 29.07.2023 20:50

Thank you for this, It;s really helpful, however, I am experiencing an error code on

function onFormSubmit(e) {
var responses = e.namedValues;
var email = responses['Email address'][0].trim();
Logger.log('; responses=' + JSON.stringify(responses));

It doesn't work at all, I have corrected all Case Sensitive issues still not working.

Ответить
Jamie Anne Sta. Isabel
Jamie Anne Sta. Isabel - 17.07.2023 13:23

Hi! Thank you for this. What code should I add if I want to add an image as an attachment? On form submit. I want to send a confirmation email for a webinar with a virtual background.

Ответить
Marco Smith
Marco Smith - 07.07.2023 06:21

Hello, great and quick video, followed the instructions but the emails are not being send, no errors in the Executions list, and also the details of the execution shows that the email was sent to the email address.

Ответить
Pinoy Freelancers
Pinoy Freelancers - 30.06.2023 23:49

Pinned by Code with Ahsan
@CodeWithAhsan I tried it but this is the error i got TypeError: Cannot read properties of undefined (reading '0')
at onFormSubmit(Code:25:41)

Ответить
RM Nolasco
RM Nolasco - 16.06.2023 17:48

Script editor is missing now is missing in Google sheets. how to fix?

Ответить
Ismael Ussene MUZE
Ismael Ussene MUZE - 12.06.2023 12:36

Hi Ahsan im facing the error "TypeError: Cannont read properties of undefined' i went to the line 25 and edited, I inserted my personal email and still error

Ответить
Kris Wellman
Kris Wellman - 10.06.2023 03:56

Thank you for the video!! I got it working in no time!
I was wondering though, would there be a way to send a second (different) email a day or two later to follow up on the first?

Ответить
Eric Goldstein
Eric Goldstein - 24.05.2023 13:36

Ahsan - - is there an easy way to send an e-mail to one person or another based upon a drop down in the form? In other words, based upon who the "owner' selected in the form, send the form info to them?

Ответить
Ajithesh Gupta
Ajithesh Gupta - 12.05.2023 21:51

This is not at all working. Namedvalues is empty. Please suggest

Ответить
EEE KID
EEE KID - 11.05.2023 19:13

It have any limitations? Per day auto mailing limit?

Ответить
Durian Customer Support
Durian Customer Support - 02.05.2023 15:34

Please let me know how to resolve it

Ответить
Durian Customer Support
Durian Customer Support - 02.05.2023 15:33

Hi Ahsan, I have deployed code.js in app script and set up trigger but in execution status is showing completed but with no logs

Ответить
Akritee Pathak
Akritee Pathak - 01.05.2023 17:52

Thank you so much for this.
But how can we customise it??

Ответить
Diana Zaguralska
Diana Zaguralska - 31.03.2023 17:06

Thank you a lot!!

Ответить
KBI Indonesia
KBI Indonesia - 31.03.2023 12:15

Great job Ahsan, you really saved me from paying paid add-ons with this script. A well-written code with very clear documentation. I even managed to customize the email subject by adding name field from the forms.
Thanks a lot

Ответить
Caleb Daniel
Caleb Daniel - 27.03.2023 17:28

Can I include column values from the google sheet in the email response? For instance, I have a question in my Google Form called "Area of interest" with multiple choice response values. I'd like to be able to include the selected value to this question in the email response. Thanks!!

Ответить
Ib Ek
Ib Ek - 05.03.2023 03:07

Worked for me. With some few adjustments because my Google form is in french. Despite that, it works very well. Many thanks !

Ответить
Anish Sharma
Anish Sharma - 01.03.2023 20:13

Firstly thanks for the tutorial, just that i have done the similar operations also i am getting executions after form submission, just that neither the mail is getting sent not can i find the logs which can make me sure about the message. Please help

Ответить
Belgian Templar
Belgian Templar - 28.02.2023 15:07

Hey mate! One year later, and your explanations are still top-notch! Quick question though! It appears that the emails' format is a bit weird on mobile. Any idea how to corrige that? The text is centered and appears as a column.

Ответить
Suktipol Kiatthaveephong
Suktipol Kiatthaveephong - 28.02.2023 15:01

Great work!! A flexible and simple way for creating email responses. Thank you

Ответить
Prince David
Prince David - 28.02.2023 01:03

Wow as smooth as butter

Ответить
Amit Bhati
Amit Bhati - 23.02.2023 18:48

The column name in the excel sheet and the column name in the code is same but after this its showing (namedValues) error

Ответить
Amit Bhati
Amit Bhati - 23.02.2023 18:14

The column name in the excel sheet and the column name in the code is same but after this its showing (namedValues) error

Ответить
Fiona Wylie
Fiona Wylie - 05.02.2023 18:44

This is amazing, and so helpful; I have been struggling for weeks with this. The only thing I can't find is how to personalise it as you mention at the end. Not a deal breaker but would have been the icing on the cake. Thanks so much.

Ответить
alessieric1
alessieric1 - 04.02.2023 21:20

hi Ahsan! I don't get that option "Choose which function to run", it only shows "myFunction" there is no dropdown menu with onform submit for that first line. is there any other way to go about it?

Ответить
Indranil Chakraborty
Indranil Chakraborty - 31.01.2023 23:36

Service invoked too many times for one day: email.
at onFormSubmit(Code:22:11) solution?

Ответить
THE MJ STUDIO
THE MJ STUDIO - 09.01.2023 21:27

Can you share how to customize email as i have alingment issues please help!

Ответить
Radhika Kushwaha
Radhika Kushwaha - 15.12.2022 16:13

Too fast unable to understand anything

Ответить
Joe Abraham
Joe Abraham - 24.11.2022 08:30

When I try to open the Apps Script from the extensions menu bar, I get the error 'sorry unable to open the file at this time' message. Please check the address and try again'. Can someone help me out here? Thanks

Ответить
Coach Lex dePraxis | 𝗞𝗟𝗜𝗞! 👍
Coach Lex dePraxis | 𝗞𝗟𝗜𝗞! 👍 - 06.11.2022 18:31

this is stil working. thank you.. 🙏🙏

Ответить
YPbeauty
YPbeauty - 14.10.2022 07:06

Tried it and it worked! But my google doc has images with hyperlinks. When the email is sent, the hyperlinks of the images don't work. Is there a way around this?

Ответить
Mohamad Meerasa P
Mohamad Meerasa P - 29.09.2022 18:06

Bro is there any limit of sending emails? Like per day only this much have to be send or its unlimited?

Ответить
Christan Brannon
Christan Brannon - 23.09.2022 18:58

Excellent video! Now looking for a way to set the 'from' email address. Is it possible to set it to another gmail or other email address?

Ответить
ajihx
ajihx - 18.08.2022 22:48

For some reason, the email isn't sending. Can you help me with this?

Ответить
Geoff Scott
Geoff Scott - 22.07.2022 22:07

Great tool to use. thank you.
Is there a way to choose columns or fields to include in the body of the email and personalize the email with a name column from the spreadsheet? TIA

Ответить