From 8d3983fd08ea9fd35a2e8b6e0081d51d7e315df8 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Wed, 16 Aug 2023 19:24:16 -0700 Subject: [PATCH] Add mail provider. --- wise-webapp/pom.xml | 5 +++++ .../main/java/com/wisemapping/mail/NotificationService.java | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/wise-webapp/pom.xml b/wise-webapp/pom.xml index f39c3670..a2a93f2c 100644 --- a/wise-webapp/pom.xml +++ b/wise-webapp/pom.xml @@ -174,6 +174,11 @@ jakarta.mail-api 2.1.2 + + org.eclipse.angus + jakarta.mail + 1.0.0 + com.mysql mysql-connector-j diff --git a/wise-webapp/src/main/java/com/wisemapping/mail/NotificationService.java b/wise-webapp/src/main/java/com/wisemapping/mail/NotificationService.java index fc7ce39b..91d2018b 100644 --- a/wise-webapp/src/main/java/com/wisemapping/mail/NotificationService.java +++ b/wise-webapp/src/main/java/com/wisemapping/mail/NotificationService.java @@ -24,6 +24,7 @@ import com.wisemapping.model.Mindmap; import com.wisemapping.model.User; import com.wisemapping.rest.model.RestLogItem; import org.apache.commons.lang.StringEscapeUtils; +import org.apache.logging.log4j.Level; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.jetbrains.annotations.NotNull; @@ -33,6 +34,7 @@ import org.springframework.context.i18n.LocaleContextHolder; import org.springframework.context.support.ResourceBundleMessageSource; import jakarta.servlet.http.HttpServletRequest; + import java.io.IOException; import java.io.PrintWriter; import java.io.StringWriter; @@ -143,7 +145,8 @@ final public class NotificationService { private void handleException(Exception e) { System.err.println("An expected error has occurred trying to send an email notification. Usually, the main reason for this is that the SMTP server properties has not been configured properly. Edit the WEB-INF/app.properties file and verify the SMTP server configuration properties."); System.err.println("Cause:" + e.getMessage()); - + e.printStackTrace(); + logger.log(Level.ERROR, e); } public void setMailer(Mailer mailer) {