diff --git a/src/main/java/org/datasurvey/service/MailService.java b/src/main/java/org/datasurvey/service/MailService.java index 0575e3d..c40c4fe 100644 --- a/src/main/java/org/datasurvey/service/MailService.java +++ b/src/main/java/org/datasurvey/service/MailService.java @@ -109,4 +109,10 @@ public class MailService { log.debug("Sending password reset email to '{}'", user.getEmail()); sendEmailFromTemplate(user, "mail/passwordResetEmail", "email.reset.title"); } + + @Async + public void sendPasswordRestoredMail(User user) { + log.debug("Sending password restored email to '{}'", user.getEmail()); + sendEmailFromTemplate(user, "mail/passwordRestoredEmail", "email.restored.title"); + } } diff --git a/src/main/java/org/datasurvey/web/rest/AccountResource.java b/src/main/java/org/datasurvey/web/rest/AccountResource.java index afb4a0c..6b830e9 100644 --- a/src/main/java/org/datasurvey/web/rest/AccountResource.java +++ b/src/main/java/org/datasurvey/web/rest/AccountResource.java @@ -173,6 +173,7 @@ public class AccountResource { // Pretend the request has been successful to prevent checking which emails really exist // but log that an invalid attempt has been made log.warn("Password reset requested for non existing mail"); + throw new EmailNotExistException(); } } @@ -192,6 +193,8 @@ public class AccountResource { if (!user.isPresent()) { throw new AccountResourceException("No user was found for this reset key"); + } else { + mailService.sendPasswordRestoredMail(user.get()); } } diff --git a/src/main/resources/templates/mail/passwordRestoredEmail.html b/src/main/resources/templates/mail/passwordRestoredEmail.html new file mode 100644 index 0000000..e1c4082 --- /dev/null +++ b/src/main/resources/templates/mail/passwordRestoredEmail.html @@ -0,0 +1,329 @@ + + + + + + + + + + + JHipster password restored + + + + + + + +
+
+ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌  +
+
+ + + + + + + + + + + + + + + +
+ + + + +
+
+ +
+ + + + +
+
+

Hello!

+

For your JHipster account a password has been successfully reset

+

+ Iniciar Sesión +

+
+
+

+ If you did not make this change, please notify the following email immediately + + datasurvey@gmail.com +

+
+
+

+ Regards, +
+ JHipster. +

+
+
+
+ + + + + + + + +
+

DataSurvey.org

+
+
+
+ +