public class EmailDispatcher extends RateLimitedDispatcher
log
Constructor and Description |
---|
EmailDispatcher() |
Modifier and Type | Method and Description |
---|---|
void |
dispatch(String messageSubject,
String messageContent,
String to)
Dispatch a message to a recipient that doesn't care what produced it.
|
String |
getName() |
boolean |
isAvailable() |
void |
setFrom(String from) |
void |
setMessageContentType(String contentType) |
void |
setSender(org.springframework.mail.MailSender sender) |
void |
setSmtpHost(String host) |
void |
tryLookup()
Try to perform the lookup of the email service.
|
dispatch, isSendAllowed, setCooldownSeconds
public String getName()
public void setFrom(String from)
from
- Email address that the notification is to come from.public void setSmtpHost(String host)
host
- The outgoing SMTP server address.public void setMessageContentType(String contentType)
contentType
- The content type of the message to be sent. For example, "
text/plain".public void setSender(org.springframework.mail.MailSender sender)
sender
- the sender to set@PostConstruct public void tryLookup()
public void dispatch(String messageSubject, String messageContent, String to) throws Exception
RateLimitedDispatcher
dispatch
in class RateLimitedDispatcher
messageSubject
- The subject of the message to send.messageContent
- The plain-text content of the message to send.to
- A description of where it is to go.Exception
- If anything goes wrong.public boolean isAvailable()
Copyright © 2015–2018 The Apache Software Foundation. All rights reserved.