0

I'm about to create a Google Form which will export to a Google Sheet. I want to be able to send an email notification to a specific email address (from a list of addresses) based on an answer (which would be in a cell in column C) when the form is submitted.

Example:

UserA answers first question which is required: "What region are you from?"

based on that answer, I want an email to be sent to a specific email address from a list of addresses.

If UserA answers South East an email will be sent to Bob@acme.com

If UserA answers North, an email will be sent to Betty@acme.com

If UserA answers West, an email will be sent to Frank@acme.com

Thanks.

Anthony Coz
  • 79
  • 1
  • 2
  • 9

1 Answers1

0

You can use an object and test the incoming value for the Col C.

Example:

var emails ={"South East": "Mail1@some.com, "North": "Mail2@some.com", ... }

And then assuming the column c goes like..

var colC = e.namedValues['xxx'];

var recipient = emails[colC];

This is just the general methodology. You can also use switch statement. You should validate the input before proceeding to confirm if the user value is valid. Plenty of tuts available on email notification on form submit.

Karan
  • 1,187
  • 2
  • 9
  • 16