
br.com.jhonsapp.notifier.NotifierByEmail Maven / Gradle / Ivy
package br.com.jhonsapp.notifier;
import javax.inject.Inject;
import br.com.jhonsapp.email.dispatcher.EmailDispatcher;
import br.com.jhonsapp.email.dispatcher.Message;
import br.com.jhonsapp.notifier.NotifierType.ServiceType;
@NotifierType(ServiceType.EMAIL)
public class NotifierByEmail implements Notifier {
@Inject
private EmailDispatcher emailDispatcher;
@Override
public void notify(Notification notification) {
if (notification == null)
throw new IllegalArgumentException("The notification can not be null.");
Message message = new Message(notification.getSender(), notification.getSubject(), notification.getMessage());
emailDispatcher.send(message);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy