Last active
July 21, 2022 15:17
-
-
Save chemiadel/f1314bf8403eda071ca10c584947d1e7 to your computer and use it in GitHub Desktop.
Revisions
-
chemiadel revised this gist
Sep 12, 2021 . 1 changed file with 1 addition and 3 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,4 @@ //https://gist.github.com/chemiadel/f1314bf8403eda071ca10c584947d1e7 //Sheet Name SHEET_NAME="Emails" -
chemiadel created this gist
Jan 30, 2018 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,29 @@ //MADE BY CHEMI ADEL //EMAIL : pace3man@gmail.com //VISIT US : www.sheetmania.com //Sheet Name SHEET_NAME="Emails" function sendEmails() { //Assign Spreadsheet, Sheet to object variables var ss=SpreadsheetApp.getActiveSpreadsheet(); var sheet=ss.getSheetByName(SHEET_NAME); //Get data into 2D Array var values=sheet.getRange('A2:E'+sheet.getLastRow()).getValues(); for(var i in values){ //Verify if email is Ready if(values[i][3]!='Ready') continue; //Verify if Email sent before to avoid resending it again if(values[i][4]!='Sent') continue; //Send Email (Email Adress, Title, Body) GmailApp.sendEmail(values[i][0], values[i][1], values[i][2]); //Mark sent to each email has been sent sheet.getRange(2+parseInt(i), 5).setValue('Sent'); } }