2

Is it possible to send emails onSubmit() with Google Apps Script Custom Web Forms just like we can do using mailApp with Google Forms?

I am currently transferring google forms code into html forms but I can't seem to find how I would be able to send email notifications like I have done for Google Forms.

Any pointers/links will be really helpful.

1 Answer 1

3

You need to use the google.script.run.myServerFunctionName() client side API. You will need to use that anyway, in order to send the form data, unless you are using a HTTPS GET or POST request to send the data somewhere.

Apps Script documentation - google.script.run

2
  • Yes I am using that function only but can MailApp work without using the onSubmit trigger? Is it possible to send emails if they weren't onSubmit? Commented Jun 4, 2016 at 21:11
  • You can make a Web App behave however you want. If the user didn't enter values, and you want to send them an email that they didn't enter any values, you can do that. An HTML form in a web app can't trigger an "On Form Submit" trigger, but it would never need to. If for some reason you want to write data to a Google Form, you can do that without even using a Google Form. A web app form is basically a website. Which is different than a Google Form. There is a submit() method. Link Submit() referenc
    – Alan Wells
    Commented Jun 6, 2016 at 1:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.