blossom-project / blossom

Blossom is a Java framework based on Spring-Boot which enables you to realize your projects quickly and smoothly. It comes with several modules and tools made to ease and speed up your development process.
http://blossom-project.com
Apache License 2.0
21 stars 21 forks source link

Mailsender interface #204

Closed RLejolivet closed 5 years ago

RLejolivet commented 5 years ago

Rework MailSender's interface.

The goals of this new interface avoid doubling the number of methods for each new functionality, like what happened with addresses going from String to InternetAddress ; as well as being easier to work with by only using the methods you need.

How it works:

Note on async: since the "send" method is now not part of the MailSender but of an object created from it (and not managed by Spring, so no AOP available there), another service (AsyncMailSender) is used to benefit from Spring's @Async.
The default AsyncMailSender implementation simply calls the synchronous send method benefiting from Spring's Async.

Deprecated by this PR:

Still undecided:

coveralls commented 5 years ago

Coverage Status

Coverage increased (+2.2%) to 56.251% when pulling 139185ada90ce1068edbc875f6b20245a6d26a83 on RLejolivet:mailsender-interface into 4178c32039e9a68b6a7bfd3bf03506b5fa1705fc on blossom-project:master.