I am currently trying to set up a checklist of sorts. I want to be able to automate a notification system by checking if the checkbox in column w has been ticked off, if not the code should then check the name in column b to retrieve the email.
function email(e) {
var spreadsheet = SpreadsheetApp.getActiveSheet();
var sheet = spreadsheet.getRange('w2');
for (var i = 0; i < sheet.length; i++) {
for (var j = 0; j > sheet[i].length; j++) {
if (values [i][j] !== true) {
var receiver;
var videoName = e.values [1];
if (videoName == "Brian Stephens") {
receiver = "[email protected]";
} else if (videoName == "Winston Nguyen") {
receiver = "[email protected]";
} else if (videoName == "Tony Wicks") {
receiver = "[email protected]";
} else if (videoName == "DeJuan Boyd") {
receiver = "[email protected]";
} else if (videoName == "Henry Lam") {
receiver = "[email protected]";
} else if (videoName == "Heidi Nguyen") {
receiver = "[email protected]";
} else if (videoName == "Melo Tang") {
receiver = "[email protected]";
}
var subject = "Upload your video";
var body = "You have yet to upload your video. Remember to check it off on the sheet.";
MailApp.sendEmail(receiver, subject, body);
return;
}
}
}
}
New contributor
Henry Lam is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.