From 7651dcb473f81b384e70ed2c74f79ae7f0b745e6 Mon Sep 17 00:00:00 2001 From: alexm Date: Wed, 23 Nov 2022 14:43:18 +0100 Subject: [PATCH] feat: resetPasswordRequest use more params --- back/methods/account/recover-password.js | 2 +- back/models/user.js | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/back/methods/account/recover-password.js b/back/methods/account/recover-password.js index f08ff8968..ddea76829 100644 --- a/back/methods/account/recover-password.js +++ b/back/methods/account/recover-password.js @@ -19,7 +19,7 @@ module.exports = Self => { const models = Self.app.models; try { - await models.user.resetPassword({email}); + await models.user.resetPassword({email, emailTemplate: 'recover-password'}); } catch (err) { if (err.code === 'EMAIL_NOT_FOUND') return; diff --git a/back/models/user.js b/back/models/user.js index d0992923c..b24d702b3 100644 --- a/back/models/user.js +++ b/back/models/user.js @@ -16,7 +16,11 @@ module.exports = function(Self) { url: `${origin}/#!/reset-password?access_token=${info.accessToken.id}` }; - const email = new Email('recover-password', params); + const options = Object.assign({}, info.options); + for (const param in options) + params[param] = options[param]; + + const email = new Email(options.emailTemplate, params); return email.send(); });