The sheet was created as part of an RSVP process to an event. By checking the Location Check box in Column 14, an email with our location will be sent to the recipient in Column 2.
This is the script I have. I have played with it so much, changing around so many little things, but nothing seems to work.
function onEdit()
{
const sheetName = SpreadsheetApp.getActiveSpreadsheet().getSheetName();
const activeCell = SpreadsheetApp.getActiveSpreadsheet().getActiveCell();
if( activeCell.getColumn() == (14) && activeCell.getRow > 2 )
{
const recipient = activeCell.offset(0,-12).getValue();
const workshopDate = activeCell.offset(0,-9).getValue();
MailApp.sendEmail
(
recipient, "Here's where to find us for the Interview Workshop ",
"Hi there,"+ "/n" + "/n"+
"Thank you so much for confirming that you will be joining us for our interview workshop on " + workshopDate + ". " + "/n" +
"The workshop will be held at ________________" + "/n" +
"Registration is from 8h00 - 8h30, we will begin promptly at 9 and finish between 3h00 and 3h30" + "/n" + "/n" +
"We're really looking forward to seeing you there!" + "/n" +
"- The Enbaya Careers Team"
);
};
};
Any ideas?
You can try this. (Sorry the question was already closed so I just posted this here to give you an example that uses the event object to take a look at) Try using an installable trigger for the function. Be sure when you use an installable trigger to change the name otherwise you get two triggers.
function onMyEdit(e) {
const sh = e.range.getSheet();
if (sh.getName() == 'Sheet1' && e.range.columnStart == 14 && e.range.rowStart > 2 && e.value == 'TRUE') {
const recipient = e.range.offset(0, -12).getValue();
const workshopDate = e.range.offset(0, -9).getValue();
MailApp.sendEmail(
recipient, "Here's where to find us for the Interview Workshop ",
"Hi there," + "/n" + "/n" +
"Thank you so much for confirming that you will be joining us for our interview workshop on " + workshopDate + ". " + "/n" +
"The workshop will be held at ________________" + "/n" +
"Registration is from 8h00 - 8h30, we will begin promptly at 9 and finish between 3h00 and 3h30" + "/n" + "/n" +
"We're really looking forward to seeing you there!" + "/n" +
"- The Enbaya Careers Team"
);
};
}
I didn't debug it