I have a bit of experience with Google Apps Scripts, and already have one setup that emails specific people when a certain form is submitted.
I am now trying to set one to do slightly different task. There is a form that students fill out requesting to have a document printed by the Librarian. The Librarian has the sheet setup with the following headers:
Print Job Completed?, Timestamp, Email Address, Name, Class Printing is for, Click yes that you understand printing is in black and white only, Attached document
In this Sheet, the first column named "Print Job Completed?" is setup as a dropdown list with the only option of "YES!!!" . The default value for this field is blank
What the Librarian is hoping to accomplish, is the following: When she prints one of the submitted documents, find that row in the Sheet and change column one value to "YES!!!" and then she would like the Apps Script to send an email to the "Email Address" for that particular row, to let them know that document "Class Printing for" has been printed and is ready for pickup. I am sure that is as clears mud, lol.
I read an article that was sort of in line with what I am trying to accomplish, and here is what I have so far, which doesnt work, so I have no doubt I am doing it wrong. I am wondering if this fine group of Admins might be able to help figure this out, if its even possible. Thanks!!
function sendEmail(e){
const r = e.range; // Cell being edited.
const row = r.rowStart; // Row of the edit.
const col = r.columnStart; // Column of the edit.
const sh = r.getSheet(); // Sheet of the edit.
if (col === 1 && sh.getRange(row,4).getValue() == "Yes") {
const caseStatus = sh.getRange(row,5).getValue();
const email = sh.getRange(row,3).getValue();
const keName = sh.getRange(row,3).getValue();
const msg = "Hello, " + keName + ". Your document: " + caseStatus + " has been printed and is ready for pickup in the Library. Thank you.";
MailApp.sendEmail(email, "Document printed!", msg)}
}