implements html override in forgotPassword

This commit is contained in:
James
2020-08-18 17:24:33 -04:00
parent 3d652b2c9a
commit ada2b79054
2 changed files with 5 additions and 1 deletions

View File

@@ -46,13 +46,15 @@ async function forgotPassword(args) {
await user.save();
if (!disableEmail) {
const html = `You are receiving this because you (or someone else) have requested the reset of the password for your account.
let html = `You are receiving this because you (or someone else) have requested the reset of the password for your account.
Please click on the following link, or paste this into your browser to complete the process:
<a href="${config.serverURL}${config.routes.admin}/reset/${token}">
${config.serverURL}${config.routes.admin}/reset/${token}
</a>
If you did not request this, please ignore this email and your password will remain unchanged.`;
if (args.generateEmailHTML) html = args.generateEmailHTML(token);
email({
from: `"${config.email.fromName}" <${config.email.fromAddress}>`,
to: data.email,

View File

@@ -4,6 +4,7 @@ async function forgotPassword(options) {
data,
expiration,
disableEmail,
generateEmailHTML,
} = options;
const collection = this.collections[collectionSlug];
@@ -14,6 +15,7 @@ async function forgotPassword(options) {
overrideAccess: true,
disableEmail,
expiration,
generateEmailHTML,
});
}