Skip to content

Instantly share code, notes, and snippets.

@JustinByrne
Created May 6, 2020 11:55
Show Gist options
  • Save JustinByrne/4ff9418258be3eaafa0a5ec34bb61ef8 to your computer and use it in GitHub Desktop.
Save JustinByrne/4ff9418258be3eaafa0a5ec34bb61ef8 to your computer and use it in GitHub Desktop.
// send email
function email(subject, body, col = "email") {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheets()[0];
var selection = ss.getActiveRange();
var currRow = selection.getRowIndex();
var emailCol = getColByName(col);
var email = sheet.getRange(currRow, emailCol).getValue();
MailApp.sendEmail(email, subject, 'New Email', {
replyTo: "",
htmlBody: body
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment