File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
src/main/java/com/github/throyer/common/springboot/domain/services/email Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change 66import org .slf4j .LoggerFactory ;
77import org .springframework .beans .factory .annotation .Autowired ;
88import org .springframework .http .HttpStatus ;
9+ import org .springframework .mail .MailException ;
910import org .springframework .mail .javamail .JavaMailSender ;
1011import org .springframework .mail .javamail .MimeMessageHelper ;
1112import org .springframework .stereotype .Service ;
@@ -32,7 +33,8 @@ public void send(Email email) {
3233 helper .setSubject (email .getSubject ());
3334 helper .setText (engine .process (email .getTemplate (), email .getContext ()), CONTENT_IS_HTML );
3435 sender .send (message );
35- } catch (MessagingException exception ) {
36+ LOGGER .info ("Email enviado com sucesso para: {}" , email .getDestination ());
37+ } catch (MessagingException | MailException exception ) {
3638 LOGGER .error (ERROR_MESSAGE , exception );
3739 throw new ResponseStatusException (HttpStatus .INTERNAL_SERVER_ERROR , ERROR_MESSAGE );
3840 }
You can’t perform that action at this time.
0 commit comments