单击时,按钮不会在服务器脚本上执行sendEmail(widget)
。但它也没有显示任何错误。
function sendEmail(record) {
var to = record.OwnerEmail;
var subject = 'Contract Renewal Notice';
var body = 'Hello!<br/><p>Please be inform that your following contract is expiring soon:\n<br/>\n</p>'+
'<b>Contract Name</b>'+'<?= record.Name ?><br/>'+
'<b>Contract Value</b>'+'<?= record.Currency ?>'+' '+'<?= record.ContractValue ?><br/>'+
'<b>Contract Owner</b>'+'<?= record.OwnerName ?><br/>'+
'<b>Vendor Name</b>'+'<?= record.VendorName ?><br/>'+
'<a href="<?= record.FileURL ?>">Open contract document</a></br>'+
'Please act upon it. Thank You!';
MailApp.sendEmail(to, subject, body);
}
我做得对吗?