(https://i.sstatic.net/pBCdHixf.png)
The send email in onEdit function is not working.
When i tried to use only the code for sending an email. It is working but not in onEdit function.
Here’s the sample code. The goal is everytime the user check the box, it will send an email to the recipient.
function onEdit(e) {
var range = e.range;
var col = range.getColumn();
var row = range.getRow();
var edited_value = e.value();
var ss = e.range.getSheet();
if (col == 12 && edited_value == "TRUE") {
var message = "This is a test of HTML <br><br> Line two";
var recipientsTO = "[email protected]" + "," + "[email protected]";
var recipientsCC = "[email protected]";
var Subject = "Poynt Received New Feedback ";
var html = message;
GmailApp.sendEmail({
to: recipientsTO,
cc: recipientsCC,
subject: Subject,
htmlBody: html
});
}
}
New contributor
Ceej Dela Cruz is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.