Created
October 21, 2017 19:28
-
-
Save barrieroberts/5a88dd8cb8475a2d3d0e797134024ac8 to your computer and use it in GitHub Desktop.
14a Problem log & email
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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