help sending form responses to multiple emails when form is submitted

634 views
Skip to first unread message

Emily Laliberte

unread,
Aug 28, 2021, 4:52:44 PM8/28/21
to Google Apps Script Community
Hi there,

I am trying to get this form and sheet to send an email to multiple users when a form is submitted. It will be used for when people meet to discuss a student, and I want a summary from the meeting to go to all the participants to ensure that everyone gets the information. 

I am unable to use any add-ons because my district has blocked them, but I feel like I might be able to do this with an apps script. Could anyone help me with the script? It will likely be 8-10 emails that it would need to go to.

Thank you!

-------------------------------------------------------

This email is intended for municipal / educational use only and must comply with the Town of Franklin and Franklin Public School's policies and state/federal laws. Under Massachusetts Law, any email created or received by an employee of The Town of or Franklin Public Schools is considered a public record.  All email correspondence is subject to the requirements of M.G.L. Chapter 66. This email may contain confidential and privileged material for the sole use of the intended recipient. Any review or distribution by others is strictly prohibited. If you are not the intended recipient please contact the sender and delete all copies.

Scott Bennett

unread,
Aug 28, 2021, 5:04:29 PM8/28/21
to google-apps-sc...@googlegroups.com
You would grab the the data from the sheet and create an email. Will you always be emailing the same group of people or will it change depending on the meeting?

Scott Bennett


Sent from my iPhone 

On Aug 28, 2021, at 3:52 PM, Emily Laliberte <lalib...@franklinps.net> wrote:

Hi there,
--
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/65b726de-30ef-4038-b13c-9988da52d654n%40googlegroups.com.

cbmserv...@gmail.com

unread,
Aug 28, 2021, 7:56:40 PM8/28/21
to google-apps-sc...@googlegroups.com

Hi Emily,

 

Would be happy to help you out with this.

 

Just need to know some more specifics on whether the email addresses are available in another sheet or whether hardcoded in software.

 

 Also, maybe good to add a second part of the form to capture the summary of meeting.

 

Send me an email and can help you with this. cbmser...@gmail.com (no fee needed).

--

ธีระศักดิ์ คนตรง

unread,
Aug 29, 2021, 3:56:23 AM8/29/21
to google-apps-sc...@googlegroups.com
you may keep all emails in an Array
and send by using loop of array.


ในวันที่ อา. 29 ส.ค. 2021 03:52 น. Emily Laliberte <lalib...@franklinps.net> เขียนว่า:
--

Emily Laliberte

unread,
Aug 29, 2021, 11:18:20 AM8/29/21
to Google Apps Script Community
Each student might have a different list of teacher emails for the summary to be sent to, but each time the form submitted it would go to the same people for that particular student. No need to change it.

I guess, in theory I could just send it to the people who weren't there but that seems overly complicated. 

To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-community+unsub...@googlegroups.com.

Phillip Bainbridge

unread,
Aug 29, 2021, 2:08:05 PM8/29/21
to Google Apps Script Community
Hi Emily

We do this lots at my place of work so I have a blog post I created for it here. I've got lots of comments in the code to try and explain what each bit is doing if you want to give it a go yourself.

Kind regards
Phil

Clark Lind

unread,
Aug 30, 2021, 9:09:01 AM8/30/21
to Google Apps Script Community
I'm always impressed with how clean your code looks Phil! :)

Phillip Bainbridge

unread,
Aug 30, 2021, 1:40:21 PM8/30/21
to Google Apps Script Community

Thank you very much Clark!  :D

Kevin

unread,
Sep 1, 2021, 12:49:38 PM9/1/21
to Google Apps Script Community
Hey Phil is a sheet needed for this. Is it possible to just go from form right to email? if so, how? Don't mean to hijack thread but am trying to do the same thing as Emily but without the need for storing data in sheets. 

On Sunday, August 29, 2021 at 2:08:05 PM UTC-4 phil...@outlook.com wrote:

Phillip Bainbridge

unread,
Sep 1, 2021, 1:18:17 PM9/1/21
to Google Apps Script Community
Hi Kevin

My example assumes a Google Sheet yes (because it writes back to it). The 'Script Editor' is available directly from a Google Form however (via the 3 dots at the top right when editing a Form), so you can do it entirely just via the Google Form yes.

You would pop the code in there instead and remove the lines about getting a Google Sheet. You would also create the Trigger via this Script Editor too.

Kind regards
Phil

Erika Knollenberg

unread,
Aug 16, 2022, 5:13:12 PM8/16/22
to Google Apps Script Community
Hi Phil,

Thank you for sharing this code. Where does one enter the addresses to which the notifications should be sent based on which values were selected in the form?

Phillip Bainbridge

unread,
Aug 17, 2022, 6:00:26 AM8/17/22
to Google Apps Script Community

Hi Erika

To update the email address: open a copy of the Google Sheet > Extensions > Script Editor > go to Line 33 and replace 'ma...@example.com' with the relevant email address (making sure it is in single or double quotes - so it remains red in colour).

It's currently only setup to work with one email address however.

Kind regards
Phil

Erika Knollenberg

unread,
Aug 18, 2022, 12:10:38 PM8/18/22
to Google Apps Script Community
Phil - Thanks. Is there a script out there where one can set it up to send to specific email addresses based on which values were selected in the form?

Phillip Bainbridge

unread,
Aug 19, 2022, 3:15:50 AM8/19/22
to Google Apps Script Community

Good morning Erika

The closest I have available is a blog post on using a switch on a Google Form (though there are lots of different ways of achieving what you require). So if you wanted to make a copy and edit mine you are more than welcome. In the example I use the option selected on a Google Form to decide which folder should be used, but you could put an email address in there instead.

Kind regards
Phil

cbmserv...@gmail.com

unread,
Aug 19, 2022, 7:24:45 PM8/19/22
to google-apps-sc...@googlegroups.com

Hi Emily/Erika,

 

I assume this is for a school? If so, I would be happy to help put together a script for you to do this.

 

The emails sent, can go to all participants at same time? i.e. just add all email addresses in same email sent?

 

What would be good is if you add a sheet to the spreadsheet, just fill out the name of the individual in one column and then their email address in the column beside it. This way to build the email list, just need to search for the name in the first column and then take their corresponding email address in the second column.

 

Make it as follows:

 

Name                   Email Address

John doe              john...@gmail.com

Jane doe              jane...@gmail.com

Etc..

 

If this works for you, I will build a sample sheet for you to copy from.

 

From: google-apps-sc...@googlegroups.com <google-apps-sc...@googlegroups.com> On Behalf Of Emily Laliberte
Sent: August 28, 2021 1:44 PM
To: Google Apps Script Community <google-apps-sc...@googlegroups.com>
Subject: [Apps-Script] help sending form responses to multiple emails when form is submitted

 

Hi there,

--

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.

cbmserv...@gmail.com

unread,
Aug 20, 2022, 3:56:37 PM8/20/22
to google-apps-sc...@googlegroups.com

Hi Emily/Erika,

 

I put the little script together for you folks:

 

Here is the spreadsheet that has the script attached:

 

https://docs.google.com/spreadsheets/d/1Rs9wM1gkJB0OjqPU67J5J5lW0zGZZ0g9koDU2-2OqMQ/edit?usp=sharing

 

What you will need to do is the following:

 

  • From your Google form, create a spreadsheet that will store the responses
  • Open the new spreadsheet and create a new sheet in it, rename new sheet to Control. (please use exact spelling)
  • Put list of names/email addresses in that Control sheet. (make it exactly as how I have done it on sample sheet)
  • Copy script from my spreadsheet to the one you created
  • Create a trigger  “On Form Submit” and make it run the function “sendOnSubmit” on trigger.

 

Script will run when any new form entries are submitted, if no names are selected (it will send it to your email address by default, otherwise, it will send it to all the names of ppl who attended meeting (as specified in form entry).

 

Let me know if you have questions.

 Thanks,

  George

Reply all
Reply to author
Forward
0 new messages