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