mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-14 21:27:23 +01:00
Use mandrill for password resets and usernames in emails (#11277)
* use mandrill for password resets * fix email id * fix username in emails and tests * fix tests * fix package-lock
This commit is contained in:
@@ -11,7 +11,7 @@ import {
|
||||
BadRequest,
|
||||
} from '../../libs/errors';
|
||||
import * as passwordUtils from '../../libs/password';
|
||||
import { send as sendEmail } from '../../libs/email';
|
||||
import { sendTxn as sendTxnEmail } from '../../libs/email';
|
||||
import { validatePasswordResetCodeAndFindUser, convertToBcrypt} from '../../libs/password';
|
||||
import { encrypt } from '../../libs/encryption';
|
||||
import {
|
||||
@@ -303,19 +303,9 @@ api.resetPassword = {
|
||||
|
||||
user.auth.local.passwordResetCode = passwordResetCode;
|
||||
|
||||
sendEmail({
|
||||
from: 'Habitica <admin@habitica.com>',
|
||||
to: email,
|
||||
subject: res.t('passwordResetEmailSubject'),
|
||||
text: res.t('passwordResetEmailText', {
|
||||
username: user.auth.local.username,
|
||||
passwordResetLink: link,
|
||||
}),
|
||||
html: res.t('passwordResetEmailHtml', {
|
||||
username: user.auth.local.username,
|
||||
passwordResetLink: link,
|
||||
}),
|
||||
});
|
||||
sendTxnEmail(user, 'reset-password', [
|
||||
{name: 'PASSWORD_RESET_LINK', content: link},
|
||||
]);
|
||||
|
||||
await user.save();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user