mirror of
https://github.com/strapi/strapi.git
synced 2025-12-13 07:55:33 +00:00
Review email reset password template
This commit is contained in:
parent
2c43a856ce
commit
f852a732a3
@ -123,12 +123,22 @@ module.exports = {
|
|||||||
user.resetPasswordToken = resetPasswordToken;
|
user.resetPasswordToken = resetPasswordToken;
|
||||||
|
|
||||||
// Send an email to the user.
|
// Send an email to the user.
|
||||||
|
const template = `
|
||||||
|
<p>We heard that you lost your password. Sorry about that!</p>
|
||||||
|
|
||||||
|
<p>But don’t worry! You can use the following link to reset your password:</p>
|
||||||
|
|
||||||
|
<p>${url}?code=${resetPasswordToken}</p>
|
||||||
|
|
||||||
|
<p>Thanks.</p>
|
||||||
|
`;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await strapi.plugins['email'].services.email.send({
|
await strapi.plugins['email'].services.email.send({
|
||||||
to: user.email,
|
to: user.email,
|
||||||
subject: 'Reset password',
|
subject: 'Reset password',
|
||||||
text: url + '?code=' + resetPasswordToken,
|
text: template,
|
||||||
html: url + '?code=' + resetPasswordToken
|
html: template
|
||||||
});
|
});
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
return ctx.badRequest(null, err);
|
return ctx.badRequest(null, err);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user