You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

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>

额外检查项

  1. 确认Google Drive文件夹的共享权限设置正确,确保收件人有权限访问该链接,避免链接激活后出现权限错误。
  2. 验证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

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.01 16:50:19