我写了这个谷歌应用程序的脚本。 目的:每次我编辑“位置更新”脚本应该发送电子邮件至“经纪人电邮”。 这里是链接到电子数据表 :
function onEdit(e) {
var activateSheet = SpreadsheetApp.getActiveSpreadsheet();
SpreadsheetApp.setActiveSheet(activateSheet.getSheetByName('Responses'));
var sheet = SpreadsheetApp.getActiveSheet();
var range = e.range;
var row = e.range.getRowIndex();//Gets the row the change was made to.
var timestamp = sheet.getRange(row, 1).getValues(); //Gets the email
var load = sheet.getRange(row, 2).getValues(); //Gets the email
var email = sheet.getRange(row, 3).getValues(); //Gets the email
var location = sheet.getRange(row, 4).getValues(); //Gets the email
var template = HtmlService.createTemplateFromFile("template");
template.load = load;
template.location =location;
MailApp.sendEmail(email,"Hi","this is my email",{htmlBody: template.evaluate().getContent()});
}
<html>
<h1><b>This is a Check-In call for load number: <?= load ?></b></h1>
<p>
<?= location ?>
</p>
<p>
Please do not reply this email, we don't read these emails. If you have any questions/concers please <a href="google.com">Click Here</a>. We will get back to as soon as we can.
</p>
</html>