2013-08-28 98 views
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>);** 

回答

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});