【问题标题】:Unable to customize AWS SES email template无法自定义 AWS SES 电子邮件模板
【发布时间】:2020-12-21 06:00:09
【问题描述】:

我正在尝试通过 AWS SES 服务发送忘记密码的邮件。我做了这个模板

{
    "Template":{
        "TemplateName": "forgotpasswrd",
        "SubjectPart": "Forgot password ",
        "TextPart":"Text area",
        "HtmlPart":"<p>We heard that you lost your password. Sorry about that!<\/p>\r\n    <p>But don\u2019t worry! You can use the following link to reset your password:<\/p>\r\n    <a href=${url}>${url}<\/a>\r\n    <p>If you don\u2019t use this link within 1 hour, it will expire.<\/p>\r\n "
    }

}

这是我在 nodejs 中输入密码重置链接的代码。

const params = {};
    const destination = {
      ToAddresses: [String(email)],
    };
    const templateData = {};
    templateData.url = String(Url);

    params.Source = 'myemailid@gmail.com';
    params.Destination = destination;
    params.Template = 'forgotpassword';
    params.TemplateData = JSON.stringify(templateData);

Url 是我要发送的内容。

但是当我收到邮件时,它不显示链接,而只显示 html 文本

" 不过别担心!您可以使用以下链接重设密码:

${网址} 如果您在 1 小时内不使用此链接,它将过期。”

如何在邮件中发送链接?

【问题讨论】:

    标签: javascript node.js amazon-web-services express amazon-ses


    【解决方案1】:

    应该是{{url}},而不是${url}See the documentation.

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-08-05
      • 2020-11-25
      • 2020-08-31
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-09-16
      相关资源
      最近更新 更多