MailAction Class
- public class MailAction
extends Action
Action implementation to send email to a user. All params
will be passed to the MailService. By default this will
add the new message to a batch, but can also send messages
immediately.
-
Hierarchy
-
Object
Action
MailAction
-
All Implemented Interfaces
-
Serializable
protected MailService |
-
getMailService ()
|
public void |
-
init (Map params)
- Initialize the MailAction so that it can generate and batch a message.
|
public void |
-
run ()
- Run the Action; in this case, create an email based on the parameters
received in the init() method.
|
public String |
-
toString ()
|
Methods from com.bea.campaign.action.Action |
getEvent , getRandom , getRequest , getScenario , getScenarioContainer , getScenarioContainerName , getScenarioId , getScenarioName , getServiceLocator , getSession , getTimestamp , getUser , getUserId , locateService , setEvent , setRandom , setRequest , setScenario , setScenarioContainer , setServiceLocator , setSession , setTimestamp , setUser
|
BATCH_MODE
public static final String
BATCH_MODE
- parameter key to flag batch-mode (defaults to true)
CONTAINER_ID_JSP_PARAM
public static final String
CONTAINER_ID_JSP_PARAM
- The name of the jsp parameter that will contain the current
scenario container id.
If a parameter with this name is provided, it will be overwritten.
CONTAINER_NAME_JSP_PARAM
public static final String
CONTAINER_NAME_JSP_PARAM
- The name of the jsp parameter that will contain the current
scenario container name.
If a parameter with this name is provided, it will be overwritten.
DEFAULT_FROM_ADDRESS_KEY
public static final String
DEFAULT_FROM_ADDRESS_KEY
- The name of the property which holds the "from" address to use
in emails, if it is not provided
EMAIL_PROPERTY_NAME_KEY
public static final String
EMAIL_PROPERTY_NAME_KEY
- The name of the property which holds the name of the User property used to lookup
the user's email address
EMAIL_PROPERTY_SET_KEY
public static final String
EMAIL_PROPERTY_SET_KEY
- The name of the property which holds the User property set to lookup
the user's email address
FROM_PARAM
public static final String
FROM_PARAM
- parameter key for the from address
GLOBAL_BATCH
public static final String
GLOBAL_BATCH
- global batch name (if none is provided)
JSP_PARAMS
public static final String
JSP_PARAMS
- parameter key for a map of JSP parameters to pass
JSP_URI
public static final String
JSP_URI
- parameter key for the URI of a JSP to use to generate the message
MESSAGE_HEADERS
public static final String
MESSAGE_HEADERS
- parameter key for a map of mail headers
MESSAGE_TEXT_PARAM
public static final String
MESSAGE_TEXT_PARAM
- parameter key for the message text
OPT_IN_PROPERTY_NAME_KEY
public static final String
OPT_IN_PROPERTY_NAME_KEY
- The name of the email opt-in property. If this property is false for
a user, email will not be sent by the EmailAction
OPT_IN_PROPERTY_SET_KEY
public static final String
OPT_IN_PROPERTY_SET_KEY
- The name of the property set which holds the email opt-in property
SCENARIO_ID_JSP_PARAM
public static final String
SCENARIO_ID_JSP_PARAM
- The name of the jsp parameter that will contain the current
scenario id.
If a parameter with this name is provided, it will be overwritten.
SCENARIO_NAME_JSP_PARAM
public static final String
SCENARIO_NAME_JSP_PARAM
- The name of the jsp parameter that will contain the current
scenario name.
If a parameter with this name is provided, it will be overwritten.
SUBJECT_PARAM
public static final String
SUBJECT_PARAM
- parameter key for the mail subject
TO_PARAM
public static final String
TO_PARAM
- parameter key for the to address
USER_ID_JSP_PARAM
public static final String
USER_ID_JSP_PARAM
- The name of the jsp parameter that will contain the current user id.
If a parameter with this name is provided, it will be overwritten.
MailAction
public MailAction()
getMailService() Method
protected MailService
getMailService()
throws Exception
Exceptions
-
Exception
init(Map) Method
public void init(Map
params)
throws IllegalArgumentException
Initialize the MailAction so that it can generate and batch a message.
Parameters are:
- TO_PARAM: The address to send the message to; optional, if it is
not there, the user's email property (as defined in the server properties
file) will be used
- FROM_PARAM: The address to use as the message's "from" address;
optional, if it is not there, the default from address (as
defined in the server properties file) will be used
- SUBJECT_PARAM: The message subject; required
- MESSAGE_TEXT_PARAM: The message body; optional
- JSP_URI: A URI of a JSP that can generate a message body; optional,
at least one of MESSAGE_TEXT_PARAM and JSP_URI are required. Most
Scenarios will use the JSP_URI.
- MESSAGE_HEADERS: A Map of name/value pairs to use as headers in the
mail message; optional
- JSP_PARAMS: A Map of name/value pairs to be based to the JSP_URI as
request parameters; optional
- BATCH_MODE: A Boolean to indicate whether the message should be
batched (true), or send immediately (false); optional, defaults to "true"
-
Overrides
-
Action.init(Map)
Parameters
-
params
- A map of name/value pairs
Exceptions
-
IllegalArgumentException
run() Method
public void run()
throws ActionException
Run the Action; in this case, create an email based on the parameters
received in the init() method.
-
Overrides
-
Action.run()
Exceptions
-
ActionException
toString() Method
public String
toString()
-
Overrides
-
Object.toString()