-
Troubleshooting email sending issues in Google Apps Script
Hey, we’re working on a cool feature: getting email alerts whenever our revenue data takes a nosedive. However, it seems we aren’t receiving the emails as expected. Could any codewarriors out there lend a hand and show us where we may be going wrong in the code?
function sendEmail() { const ss = SpreadsheetApp.getActive(); const sh = ss.getSheetByName("Sheet1"); const data = sh.getRange("B2:L80" + sh.getLastRow()).getValues(); data.forEach(r => { let overdueValue = r[9]; if (overdueValue === "TRUE"){ let name = r[10]; let message = "Reach out to " + name; let subject = "Reach out to this person."; ////MailApp.sendEmail("xxxxx@gmail.com", subject, message); GmailApp.sendEmail("xxxx@gmail.com", subject, message); } }); }
Log in to reply.