
email.dispatcher.EmailDispatcherImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of email-dispatcher Show documentation
Show all versions of email-dispatcher Show documentation
A bunch of classes that facilitate sending e-mail.
The newest version!
package email.dispatcher;
import javax.ejb.Stateless;
import javax.inject.Inject;
import com.outjected.email.api.MailMessage;
import email.configuration.mailer.Mailer;
@Stateless
public class EmailDispatcherImpl implements EmailDispatcher{
private static final long serialVersionUID = -73733075856472012L;
@Inject
private Mailer mailer;
@Override
public void send(Message message){
if(message == null)
throw new IllegalArgumentException("The message can not be null.");
MailMessage mailMessage = this.mailer.newMessage();
mailMessage.to(message.getSender())
.subject(message.getSubject())
.bodyHtml(message.getHtmlContent())
.send();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy