Devang Mukherjee
Devang Mukherjee

Reputation: 197

Unable to customize AWS SES email template

I am trying to send a forgot password mail through AWS SES service. I made this template

{
    "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 "
    }

}

And this is my code in nodejs to input password reset link.

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

    params.Source = '[email protected]';
    params.Destination = destination;
    params.Template = 'forgotpassword';
    params.TemplateData = JSON.stringify(templateData);

In this Url is what i am trying to send.

However when I receive the mail its it does not show the link but only the html text

" But don’t worry! You can use the following link to reset your password:

${url} If you don’t use this link within 1 hour, it will expire."

How do I send the link in the mail?

Upvotes: 0

Views: 863

Answers (1)

ranieri
ranieri

Reputation: 2078

It should be {{url}}, not ${url}. See the documentation.

Upvotes: 2

Related Questions