我试图找出“操作方法”的格式,该格式是通过Google Apps脚本创建和发送的Gmail正文。我已经在邮件中添加了<bold>
,但是它没有加粗文本,只显示了字符<bold>
。
有人可以指出我所缺少的吗?
谢谢
var emailAddress = row[34]; // adminEmail column
var message = "<html><body>The " + row[9] + " event that was submitted by <bold>" + row[1] + "</bold> has not been approved yet. Please go to " + row[27] + " and review the admin notes.</body></html>";
var subject = "An alert for " + row[1] + " needs approval";
MailApp.sendEmail(emailAddress, subject, message);
答案 0 :(得分:2)
尝试一下:
var emailAddress = row[34]; // adminEmail column
var message = "The " + row[9] + " event that was submitted by <b>" + row[1] + "</b> has not been approved yet. Please go to " + row[27] + " and review the admin notes.";
var subject = "An alert for " + row[1] + " needs approval";
MailApp.sendEmail(emailAddress, subject, '', {
htmlBody: message
});
使用sendEmail(recipient, subject, body, options)
您可以使用选项htmlBody
输入HTML
请参阅文档here。
<bold>
也不起作用,并且不是有效的HTML
标记,因此请改用<b></b>