mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-09 07:25:46 +01:00
fix: bug where confirmation email was sent to the old email address, not the new one
This commit is contained in:
@@ -219,6 +219,12 @@ Emailer.send = async (template, uid, params) => {
|
||||
}
|
||||
|
||||
let userData = await User.getUserFields(uid, ['email', 'username', 'email:confirmed']);
|
||||
|
||||
// 'welcome' and 'verify-email' explicitly used passed-in email address
|
||||
if (['welcome', 'verify-email'].includes(template)) {
|
||||
userData.email = params.email;
|
||||
}
|
||||
|
||||
({ template, userData, params } = await Plugins.hooks.fire('filter:email.prepare', { template, uid, userData, params }));
|
||||
if (!userData || !userData.email) {
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
|
||||
Reference in New Issue
Block a user