Reputation: 1
I'm trying to insert a hyperlink in a google script but it returns the text clear without a hyperlink. Check below:
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>);**
Upvotes: 0
Views: 218
Reputation: 702
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>");
You have to make sure the HTML you include is actually apart of the message, not outside of it.
I would also put the entire message in a message variable so the MailApp is rather clean. You also need to add a special attachment to make the html work. An example would be this:
MailApp.sendEmail(email,subject,message,{htmlBody:message});
Upvotes: 1