Skip to content

Instantly share code, notes, and snippets.

@barrieroberts
Created October 21, 2017 19:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save barrieroberts/5a88dd8cb8475a2d3d0e797134024ac8 to your computer and use it in GitHub Desktop.
Save barrieroberts/5a88dd8cb8475a2d3d0e797134024ac8 to your computer and use it in GitHub Desktop.
14a Problem log & email
function sendProblem() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var fr = ss.getSheetByName("Form Responses 1");
var lastRowValues = fr.getRange(fr.getLastRow(), 1, 1, fr.getLastColumn()).getValues();
var problem = lastRowValues[0][1];
var room = lastRowValues[0][2];
//Create email
var emailSubject = "Problem";
var emailTo = ["email1@gmail.com", "email2@gmail.com"];
var emailBody = "Problem: " + problem + "<br /> \
Room: " + room;
//Send email
MailApp.sendEmail(emailTo,emailSubject,'body',{
htmlBody: emailBody});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment