implements html override in forgotPassword
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user