我正在尝试向技术人员设置一封简单的提醒电子邮件,以提醒常规服务何时到期。我有一个二维数组和有效的代码,但它只发送 1 封电子邮件,这是最低行。我对此有点陌生,但我希望它遍历每一行并为每次过期发送提醒。任何帮助表示赞赏。
这就是我现在所拥有的:
function Email_Reminder()
{;
var sheet = SpreadsheetApp.getActiveSheet();
statusArray = sheet.getDataRange().getValues();
status = "overdue";
for (i=3;i < statusArray.length;i++){
if (status == statusArray[i][6]) {
var customer = statusArray[i][0];
}
}
var email = "djens12@gmail.com"
var subject = "Reminder";
var body = "This is a reminder that the service is overdue for " +customer+ "";
MailApp.sendEmail(email,subject,body,{NoReply : true});
}
谢谢