Add mail provider.

This commit is contained in:
Paulo Gustavo Veiga 2023-08-16 19:24:16 -07:00
parent 169c6e6538
commit 8d3983fd08
2 changed files with 9 additions and 1 deletions

View File

@ -174,6 +174,11 @@
<artifactId>jakarta.mail-api</artifactId>
<version>2.1.2</version>
</dependency>
<dependency>
<groupId>org.eclipse.angus</groupId>
<artifactId>jakarta.mail</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>com.mysql</groupId>
<artifactId>mysql-connector-j</artifactId>

View File

@ -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) {