0
我試圖將一個可點擊的鏈接放入使用Mailapp.SendEmail的電子郵件中。根據我讀過的其他答案,我已將鏈接分解成多個部分以避免連接混淆。但是,html仍然顯示爲電子郵件中的文本。誰能告訴我我做錯了什麼?mailapp腳本中的可點擊鏈接
function myFunction() {
var spreadsheet = SpreadsheetApp.getActive()
var responses = spreadsheet.getSheets()[0]
var lastContact = responses.getRange(1,13).getValue();
var tag1 = '<a href="'
var link = "docs.google.com/forms/d/e/1FAIpQLSfODcXSXa_xt1E78MM9uekSlOoCXwdy-EvVryY4RP0P0fZ_A/viewform"
var tag2 = '"> our registration page </a>';
var full = tag1+link+tag2
Logger.log(tag1+link+tag2)
if(responses.getLastRow()-1 > lastContact){
for(var i = lastContact+1; i<=responses.getLastRow()-1; i++){
MailApp.sendEmail(responses.getRange(i,4).getValue(), "Registration Confirmed: South and Southeast Queens Rising", "Hello, "+ responses.getRange(i,2).getValue() +" "+responses.getRange(i,3).getValue() + ",\n\n"
+ "Thank you for registering for our event We will be sending a detailed program for this exciting event very shortly. \n\n"
+ "We encourage you to attend the event with colleagues. To do so, please return to " + full + " to list employees, associates, and partners who will join you on September 12, 2017."
+ "We look forward to meeting you soon! \n\n"
+ "Thank you, \n"
+ "Signature"
)
}
responses.getRange(1,13).setValue(responses.getLastRow()-1)
}}
這似乎爲Outlook,但沒有爲gmail,它仍然顯示HTML文本。我知道gmail沒有html,我很猶豫是否有純文本版本,因爲鏈接相當重要。 – IAntoniazzi
將鏈接的代碼更新爲一個字符串並使用Gmail進行測試。這應該工作 - 不知道爲什麼'字符串'鏈接是在3部分..這是一個要求? –
'respond.getRange(i,2).getValue()'包含了什麼?它有HTML標籤嗎?如果是這樣,我相信他們需要封裝在[HtmlService](https://developers.google.com/apps-script/reference/html/html-output)'createHtmlOutput()' - 不是100%在此 –