0

我正在尝试在谷歌脚本中插入一个超链接,但它返回的文本是清晰的,没有超链接。检查以下:

if (emailSent != Email_Sent) {
      if (visitType == "Taking") {
        var subject = "Equipment Checked out from Storage";
        MailApp.sendEmail(emailAddress,
                          subject,
                          "Hello" +
                          "\n\nThis is a reminder for myself " + emailAddress + 
                          "\n\nI am " + visitType + " " + amount + " x " + equipment + 
                          "\n\nRemember to return it within 15 days unless i want to keep the equipment" + 
                          "\n\nThanks" +
                          "\n\n For the sake of improving our service, please complete the feedback form " + **<a href="https://docs.google.com/a/1234/sharing/.."> here </a>);**
4

1 回答 1

1
var url = "https://docs.google.com/a/1234/sharing/..";

"\n\n For the sake of improving our service, please complete the feedback form <a     href="+url+">here </a>");

您必须确保您包含的 HTML 实际上是消息的一部分,而不是消息之外。

我还将整个消息放在一个消息变量中,这样 MailApp 就相当干净了。您还需要添加一个特殊的附件以使 html 工作。一个例子是这样的:

MailApp.sendEmail(email,subject,message,{htmlBody:message});
于 2013-08-28T13:47:00.537 回答