trying to find out where i'm going wrong. I'm not a coder, but am re-using code from another google sheet I've used.
I'm trying to trigger an email being sent when a form is submitted that populates this google sheet.
Here is the public sheet: https://docs.google.com/spreadsheets/d/1oV8bwS_o7O-Wu5LXoP-0e9M71NpbQy-a0ViTSZhXJPA/edit?usp=sharing
Here is the code:
function FormSubmit(formData) {
// Load the sheets for processing
var responseSheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Master Editing Sheet");
var supData = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Support Data");
// Create and send the Email
// Description is used to make the email
var description = supData.getRange(2,1).getValue();
var name = formData.namedValues["Prospects' Names"];
var timestamp = formData.namedValues["Timestamp"];
var to = "andrew.appel@gmail.com";
var subject = "New Prospect Submitted: " + name;
var message = "New Prospect | Submitted by | Initial Contact | Initial Notes: " + "\n" + "\n";
message += description + "\n" + "\n";
message += "The Master Recruitment Spreadsheet can be viewed by clicking on the following link" + "\n";
message += "https://tinyurl.com/recruitmaster"
MailApp.sendEmail(to, subject, message);
}
Thank you so much!! Andrew