October 2018
Intermediate to advanced
590 pages
15h 5m
English
The implementation of DefaultMailManager is quite straightforward. As mentioned earlier, it uses FreeMarker to create a message body from the template and uses the Mailer API to send the message. Here is how its send() method looks:
@Componentpublic class DefaultMailManager implements MailManager { private String mailFrom; private Mailer mailer; private Configuration configuration; public DefaultMailManager(@Value("${app.mail-from}") String mailFrom, Mailer mailer, Configuration configuration) { this.mailFrom = mailFrom; this.mailer = mailer; this.configuration = configuration; } @Override public void send(String emailAddress, String subject, String template, MessageVariable... variables) { Assert.hasText(emailAddress, ...Read now
Unlock full access