To include a link in HTML you need an a tag.
You would need to include the below in your html code where the Link is to create a clickable item that brings up the webpage the user needs:
<a href="<?= l ?>">Link</a>
I didn't get on that well with your code for sending emails, one that does work is below:
function sendEmail() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sh = ss.getSheetByName('Sheet1');
var rng = sh.getDataRange();
var val = rng.getDisplayValues();
var lr = rng.getLastRow();
var name = sh.getRange("B2").getValue();
var subject = sh.getRange("B1").getValue();
for (var i = 1; i < lr; i++) {
if (val[i][0] != ""){
var html = HtmlService.createTemplateFromFile('Email');
html.e = val[i][0];
html.n = val[i][1];
html.l = val[i][2];
var htmlMessage = html.evaluate().getContent();
GmailApp.sendEmail(
val[i][0],
subject,
"Your email doesn't support HTML.",
{name: name, htmlBody: htmlMessage}
);
}
}
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…