【发布时间】:2015-09-28 00:10:02
【问题描述】:
我想发送带有多个超链接文本、换行符和粗体的电子邮件。除了.sendEmail() 文档之外,我还找到了这个question 并回答,但我仍然感到困惑。这就是我正在做的事情:
function emailTest() {
var Link1 = "https://sites.google.com/a/****/item-shop" ;
var Link2 = "https://sites.google.com/a/****/leader-board" ;
var name = "Adam";
var message = "Congratulations " + name.bold() + "!" + '\n' + '\n' + "check out this cool " + Link1 + '\n' + '\n' +
"and this cool " + Link2 + '\n' + '\n' +
"Keep up the good work!" + '\n' + "Mr. S.";
GmailApp.sendEmail ('fakename@gmail.com', "Congratulations!", message,
{htmlBody: message.replace(Link1, '<a href="https://sites.google.com/a/****/item-shop">Item Shop</a>'),
htmlBody: message.replace(Link2, '<a href="https://sites.google.com/a/****/leader-board">LeaderBoard</a>')})
}
粗体有效,只有 1 个链接没有发生换行。
感谢任何指导!
【问题讨论】: