I am trying to send a forgot password mail through AWS SES service. I made this template
JavaScript
x
10
10
1
{
2
"Template":{
3
"TemplateName": "forgotpasswrd",
4
"SubjectPart": "Forgot password ",
5
"TextPart":"Text area",
6
"HtmlPart":"<p>We heard that you lost your password. Sorry about that!</p>rn <p>But donu2019t worry! You can use the following link to reset your password:</p>rn <a href=${url}>${url}</a>rn <p>If you donu2019t use this link within 1 hour, it will expire.</p>rn "
7
}
8
9
}
10
And this is my code in nodejs to input password reset link.
JavaScript
1
13
13
1
const params = {};
2
const destination = {
3
ToAddresses: [String(email)],
4
};
5
const templateData = {};
6
templateData.url = String(Url);
7
8
params.Source = 'myemailid@gmail.com';
9
params.Destination = destination;
10
params.Template = 'forgotpassword';
11
params.TemplateData = JSON.stringify(templateData);
12
13
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?
Advertisement
Answer
It should be {{url}}
, not ${url}
. See the documentation.