提问人:Elisha Caudill 提问时间:11/17/2023 最后编辑:CooperElisha Caudill 更新时间:11/18/2023 访问量:22
Google Apps 脚本 - 根据条件向多个行收件人发送电子邮件
Google Apps Script - Sending Emails to Multiple Row Recipients Based on Condition
问:
我想根据新行响应向收件人发送电子邮件,该电子邮件也基于单元格中的条件。工作表有 L 的列,L 需要被“检查”为 true 才能触发电子邮件。我可以让第一行发送;我只是无法让它在第一封电子邮件之后继续。仅第 2 行的工作代码
function sendEmail(){ #function for email to be sent
var emailRange = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Master List").getRange("E2"); //#using name of sheet
var emailAddress = emailRange.getValue();
var message = "This is a sample message"; #sample message var subject = "HCS New Teacher Academy 2024";
var valueToCheck = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Master List").getRange("L2");
var valueToSend = valueToCheck.getValue();
if (valueToSend == true){
MailApp.sendEmail(emailAddress, subject, message);
}
}
我怎样才能写到第 2 行之后继续......我附上了电子表格的屏幕截图以供参考?
尝试发送电子邮件,但只有第 2 行
答: 暂无答案
评论
I included a screenshot
based on new row responses
I just can't get it to continue beyond the first email.