App Script HTML模板邮件中超链接无法激活问题求助
问题排查:HTML邮件超链接无法激活的原因及修复
核心问题:中文引号导致链接失效
你的HTML模板中,<a>标签的href属性使用了中文双引号“”,而HTML语法要求必须使用英文双引号""或单引号''。邮件客户端无法识别中文引号,因此无法解析出正确的链接地址,直接导致超链接无法激活。
修改后的正确模板代码
<!DOCTYPE html> <html> <head> <base target="_top"> </head> <body> <h2>Your Quality Audit is complete!</h2> <p> Hello <?= data[0];?>, </p> <p><strong>This email is to let you know that a Quality Audit was completed for you.</strong></p> <p> The next step is for you to click this <a href="https://drive.google.com/drive/folders/1MKlD631O5Rz2OdEPHsJMY7vNcPCvfTvP"> link </a> to view your audit results. </p> <p>If you have any questions regarding the audit, please reach out to your supervisor.</p> <p>Best Regards,</p> <p><?= data[4];?><br>Customer Support Team</p> </body> </html>
额外检查项
- 确认Google Drive文件夹的共享权限设置正确,确保收件人有权限访问该链接,避免链接激活后出现权限错误。
- 验证Google Apps Script的邮件发送逻辑是否正确,需确保通过
HtmlService正确渲染模板:function sendAuditEmail() { const template = HtmlService.createTemplateFromFile('EmailTemplate'); template.data = ["收件人姓名", "", "", "", "发件人姓名"]; // 替换为实际业务数据 const htmlBody = template.evaluate().getContent(); MailApp.sendEmail({ to: 'recipient@example.com', subject: 'Quality Audit Complete', htmlBody: htmlBody }); }
内容的提问来源于stack exchange,提问作者Shan Jose
相关产品推荐
相关产品推荐

