From 643695b7fa974c803af303888e72904900a399a6 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Wed, 23 Sep 2026 13:43:18 +0200 Subject: [PATCH] :sparkles: Send notification email on password change (#11393) * :sparkles: Send notification email on password change Add a password-changed email template and send it after every successful password change or first password set operation. This gives users a visible signal when a new authentication factor is established on their account. Closes #11392 AI-assisted-by: longcat-2.0 * :bug: Address code review feedback on password notification - Send password-changed notification from recover-profile too (forgot-password reset path was missing the email). - Strengthen test assertions to verify email factory, recipient, and name via :call-args-list instead of just call-count. - Add negative test: no email sent when old-password is wrong. - Wrap pre-existing update-profile-password test with send! mock to keep its scope focused. Ref: PR #11393 AI-assisted-by: longcat-2.0 --- .../app/email/password-changed/en.html | 233 ++++++++++++++++++ .../app/email/password-changed/en.subj | 1 + .../app/email/password-changed/en.txt | 8 + backend/src/app/email.clj | 10 + backend/src/app/rpc/commands/auth.clj | 11 +- backend/src/app/rpc/commands/profile.clj | 6 + .../test/backend_tests/rpc_profile_test.clj | 90 +++++-- 7 files changed, 339 insertions(+), 20 deletions(-) create mode 100644 backend/resources/app/email/password-changed/en.html create mode 100644 backend/resources/app/email/password-changed/en.subj create mode 100644 backend/resources/app/email/password-changed/en.txt diff --git a/backend/resources/app/email/password-changed/en.html b/backend/resources/app/email/password-changed/en.html new file mode 100644 index 0000000000..f1c2862873 --- /dev/null +++ b/backend/resources/app/email/password-changed/en.html @@ -0,0 +1,233 @@ + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +
+ + + + +
+ + + + + + +
+ +
+
+
+ +
+ + + +
+ +
+ + + + + + + + + + + + + + + + +
+
+ Hello {{name|abbreviate:25}}!
+
+
+ Your password has been changed. +
+
+
+ If you did not make this change, please contact support immediately or reset your password. +
+
+
+ Enjoy!
+
+
+ The Penpot team.
+
+
+