@@ -66,6 +66,7 @@ function randomPassword() {
66
66
67
67
const emailRegisterTemplate = fs . readFileSync ( __dirname + '/../register_confirmation_template.html' , 'utf8' ) ;
68
68
const emailForgotPasswordTemplate = fs . readFileSync ( __dirname + '/../reset_password_confirmation_template.html' , 'utf8' ) ;
69
+ const emailPasswordChangeTemplate = fs . readFileSync ( __dirname + '/../change_password_notification.html' , 'utf8' ) ;
69
70
70
71
function emailRegistrationConfirmation ( email , confirmationId ) {
71
72
@@ -81,6 +82,12 @@ function emailResetPasswordLink(email, resetId) {
81
82
emailService . sendEmail ( email , constants . resetPasswordConfirmationTitle , messageBody , messageBody ) ;
82
83
}
83
84
85
+ function emailPasswordChangeNotificationLink ( email ) {
86
+
87
+ const messageBody = emailPasswordChangeTemplate ;
88
+ emailService . sendEmail ( email , constants . passwordChangeNotificationTitle , messageBody , messageBody ) ;
89
+ }
90
+
84
91
async function registerUserAndGetConfirmationId ( email , password , minAge ) {
85
92
86
93
const transformedPassword = await passwordService . transformPasswordInitial ( password ) ;
@@ -352,6 +359,8 @@ if (constants.enableCustomAuth) {
352
359
353
360
if ( await changePassword ( input . email , input . oldPassword , input . newPassword ) ) {
354
361
362
+ emailPasswordChangeNotificationLink ( input . email ) ;
363
+
355
364
res . sendJson ( {
356
365
status : constants . statusCodes . ok
357
366
} ) ;
0 commit comments