Created
December 29, 2023 19:29
-
-
Save dab2020/605488562f67057ed8d8d314ea9ba197 to your computer and use it in GitHub Desktop.
Google Appscript for Sending Emails to Delegates Along with a Team ID
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 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