Package org.appng.formtags.providers
Class EmailProvider
- java.lang.Object
-
- org.appng.formtags.providers.EmailProvider
-
- All Implemented Interfaces:
FormProcessProvider
public class EmailProvider extends Object implements FormProcessProvider
AFormProcessProvider
that send's and e-mail to some receivers. All the properties of the e-mail are being set via theproperties
-Map
passed toonFormSuccess(Writer, Form, Map)
.
See the following property-keys for details:SENDER
SENDER_NAME
SUBJECT
RECEIVER_TO
RECEIVER_CC
RECEIVER_BCC
RECEIVER_DEBUG
REPLY_TO
EMAIL_CONTENT_TEXT
EMAIL_CONTENT_HTML
Writer
, seeCONTENT
andERROR_MESSAGE
.- Author:
- Matthias Müller
-
-
Field Summary
Fields Modifier and Type Field Description static String
ATTACHMENTS
Key for theproperties
-Map
passed toonFormSuccess(Writer, Form, Map)
.
If the value istrue
, the file attachments of theForm
will be added to the e-mail.static String
CONTENT
Key for theproperties
-Map
passed toonFormSuccess(Writer, Form, Map)
.
The value may contain the message that is written to theWriter
passed toonFormSuccess(Writer, Form, Map)
, in case the e-mail was successfully sent.static String
EMAIL_CONTENT_HTML
Key for theproperties
-Map
passed toonFormSuccess(Writer, Form, Map)
.
Value can contain the HTML-content for the e-mail to send.static String
EMAIL_CONTENT_TEXT
Key for theproperties
-Map
passed toonFormSuccess(Writer, Form, Map)
.
Value can contain the text-content for the e-mail to send.static String
ERROR_MESSAGE
Key for theproperties
-Map
passed toonFormSuccess(Writer, Form, Map)
.
The value may contain the message that is written to theWriter
passed toonFormSuccess(Writer, Form, Map)
, in case an error occurs while sending the e-mail.static String
RECEIVER_BCC
Key for theproperties
-Map
passed toonFormSuccess(Writer, Form, Map)
.
Value can contain a comma-separated list of e-mail addresses to send the mail withMail.RecipientType.BCC
static String
RECEIVER_CC
Key for theproperties
-Map
passed toonFormSuccess(Writer, Form, Map)
.
Value can contain a comma-separated list of e-mail addresses to send the mail withMail.RecipientType.CC
static String
RECEIVER_DEBUG
Key for theproperties
-Map
passed toonFormSuccess(Writer, Form, Map)
.
Value can contain a comma-separated list of e-mail addresses to which the e-mail will be send (instead of the real receivers)static String
RECEIVER_TO
Key for theproperties
-Map
passed toonFormSuccess(Writer, Form, Map)
.
Value must contain a comma-separated list of e-mail addresses to send the mail withMail.RecipientType.TO
static String
REPLY_TO
Key for theproperties
-Map
passed toonFormSuccess(Writer, Form, Map)
.
Value can contain a comma-separated list of e-mail addresses to reply-tostatic String
SEND_DISABLED
static String
SENDER
Key for theproperties
-Map
passed toonFormSuccess(Writer, Form, Map)
.
Value must contain the sender's e-mail addressstatic String
SENDER_NAME
Key for theproperties
-Map
passed toonFormSuccess(Writer, Form, Map)
.
Value can contain the sender's namestatic String
SUBJECT
Key for theproperties
-Map
passed toonFormSuccess(Writer, Form, Map)
.
Value must contain the subject for the e-mail
-
Constructor Summary
Constructors Constructor Description EmailProvider(MailTransport mailTransport)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isValidReceiver(String receiverEmails)
void
onFormSuccess(Writer writer, Form form, Map<String,Object> properties)
-
-
-
Field Detail
-
RECEIVER_TO
public static final String RECEIVER_TO
Key for theproperties
-Map
passed toonFormSuccess(Writer, Form, Map)
.
Value must contain a comma-separated list of e-mail addresses to send the mail withMail.RecipientType.TO
- See Also:
- Constant Field Values
-
RECEIVER_CC
public static final String RECEIVER_CC
Key for theproperties
-Map
passed toonFormSuccess(Writer, Form, Map)
.
Value can contain a comma-separated list of e-mail addresses to send the mail withMail.RecipientType.CC
- See Also:
- Constant Field Values
-
RECEIVER_BCC
public static final String RECEIVER_BCC
Key for theproperties
-Map
passed toonFormSuccess(Writer, Form, Map)
.
Value can contain a comma-separated list of e-mail addresses to send the mail withMail.RecipientType.BCC
- See Also:
- Constant Field Values
-
SENDER
public static final String SENDER
Key for theproperties
-Map
passed toonFormSuccess(Writer, Form, Map)
.
Value must contain the sender's e-mail address- See Also:
- Constant Field Values
-
SENDER_NAME
public static final String SENDER_NAME
Key for theproperties
-Map
passed toonFormSuccess(Writer, Form, Map)
.
Value can contain the sender's name- See Also:
- Constant Field Values
-
SEND_DISABLED
public static final String SEND_DISABLED
- See Also:
- Constant Field Values
-
REPLY_TO
public static final String REPLY_TO
Key for theproperties
-Map
passed toonFormSuccess(Writer, Form, Map)
.
Value can contain a comma-separated list of e-mail addresses to reply-to- See Also:
- Constant Field Values
-
SUBJECT
public static final String SUBJECT
Key for theproperties
-Map
passed toonFormSuccess(Writer, Form, Map)
.
Value must contain the subject for the e-mail- See Also:
- Constant Field Values
-
RECEIVER_DEBUG
public static final String RECEIVER_DEBUG
Key for theproperties
-Map
passed toonFormSuccess(Writer, Form, Map)
.
Value can contain a comma-separated list of e-mail addresses to which the e-mail will be send (instead of the real receivers)- See Also:
- Constant Field Values
-
EMAIL_CONTENT_HTML
public static final String EMAIL_CONTENT_HTML
Key for theproperties
-Map
passed toonFormSuccess(Writer, Form, Map)
.
Value can contain the HTML-content for the e-mail to send. One or both of text or HTML-content should be set.- See Also:
EMAIL_CONTENT_TEXT
, Constant Field Values
-
EMAIL_CONTENT_TEXT
public static final String EMAIL_CONTENT_TEXT
Key for theproperties
-Map
passed toonFormSuccess(Writer, Form, Map)
.
Value can contain the text-content for the e-mail to send. One or both of text or HTML-content should be set.- See Also:
EMAIL_CONTENT_HTML
, Constant Field Values
-
ATTACHMENTS
public static final String ATTACHMENTS
Key for theproperties
-Map
passed toonFormSuccess(Writer, Form, Map)
.
If the value istrue
, the file attachments of theForm
will be added to the e-mail.- See Also:
- Constant Field Values
-
CONTENT
public static final String CONTENT
Key for theproperties
-Map
passed toonFormSuccess(Writer, Form, Map)
.
The value may contain the message that is written to theWriter
passed toonFormSuccess(Writer, Form, Map)
, in case the e-mail was successfully sent.- See Also:
- Constant Field Values
-
ERROR_MESSAGE
public static final String ERROR_MESSAGE
Key for theproperties
-Map
passed toonFormSuccess(Writer, Form, Map)
.
The value may contain the message that is written to theWriter
passed toonFormSuccess(Writer, Form, Map)
, in case an error occurs while sending the e-mail.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
EmailProvider
public EmailProvider(MailTransport mailTransport)
-
-
Method Detail
-
onFormSuccess
public void onFormSuccess(Writer writer, Form form, Map<String,Object> properties)
- Specified by:
onFormSuccess
in interfaceFormProcessProvider
-
isValidReceiver
public boolean isValidReceiver(String receiverEmails)
-
-