Skip to content

Instantly share code, notes, and snippets.

@dab2020
Created December 29, 2023 19:29
Show Gist options
  • Save dab2020/605488562f67057ed8d8d314ea9ba197 to your computer and use it in GitHub Desktop.
Save dab2020/605488562f67057ed8d8d314ea9ba197 to your computer and use it in GitHub Desktop.
Google Appscript for Sending Emails to Delegates Along with a Team ID
function onOpen() {
var ui = SpreadsheetApp.getUi();
// Or DocumentApp, SlidesApp or FormApp.
ui.createMenu('BNA2024 Jarvis')
.addItem('Send Mail to All Teams', 'mail1')
.addToUi();
}
function mail1() {
var sheet = SpreadsheetApp.getActiveSheet();
var data = sheet.getDataRange().getValues();
for (var i = 1; i < 4; i++) {
var mail2 = data[i][0];
GmailApp.sendEmail(mail2,
'Hello',
'Hello Your Team Number is ' + data[i][1]);
Logger.log('Mail Sent to: ' + mail2)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment