© 2001 BEA Systems, Inc.

com.bea.commerce.campaign.action
Class MailAction

java.lang.Object
  |
  +--com.bea.commerce.campaign.action.Action
        |
        +--com.bea.commerce.campaign.action.MailAction
All Implemented Interfaces:
java.io.Serializable

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.

See Also:
Serialized Form

Field Summary
static java.lang.String BATCH_MODE
          parameter key to flag batch-mode (defaults to true)
static java.lang.String CONTAINER_ID_JSP_PARAM
          The name of the jsp parameter that will contain the current scenario container id.
static java.lang.String CONTAINER_NAME_JSP_PARAM
          The name of the jsp parameter that will contain the current scenario container name.
static java.lang.String DEFAULT_FROM_ADDRESS_KEY
          The name of the property which holds the "from" address to use in emails, if it is not provided
static java.lang.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
static java.lang.String EMAIL_PROPERTY_SET_KEY
          The name of the property which holds the User property set to lookup the user's email address
static java.lang.String FROM_PARAM
          parameter key for the from address
static java.lang.String GLOBAL_BATCH
          global batch name (if none is provided)
static java.lang.String JSP_PARAMS
          parameter key for a map of JSP parameters to pass
static java.lang.String JSP_URI
          parameter key for the URI of a JSP to use to generate the message
static java.lang.String MESSAGE_HEADERS
          parameter key for a map of mail headers
static java.lang.String MESSAGE_TEXT_PARAM
          parameter key for the message text
static java.lang.String OPT_IN_PROPERTY_NAME_KEY
          The name of the email opt-in property.
static java.lang.String OPT_IN_PROPERTY_SET_KEY
          The name of the property set which holds the email opt-in property
static java.lang.String SCENARIO_ID_JSP_PARAM
          The name of the jsp parameter that will contain the current scenario id.
static java.lang.String SCENARIO_NAME_JSP_PARAM
          The name of the jsp parameter that will contain the current scenario name.
static java.lang.String SUBJECT_PARAM
          parameter key for the mail subject
static java.lang.String TO_PARAM
          parameter key for the to address
static java.lang.String USER_ID_JSP_PARAM
          The name of the jsp parameter that will contain the current user id.
 
Constructor Summary
MailAction()
           
 
Method Summary
protected  MailService getMailService()
           
 void init(java.util.Map params)
          Initialize the MailAction so that it can generate and batch a message.
 void run()
          Run the Action; in this case, create an email based on the parameters received in the init() method.
 
Methods inherited from class com.bea.commerce.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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_FROM_ADDRESS_KEY

public static final java.lang.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 java.lang.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 java.lang.String EMAIL_PROPERTY_SET_KEY
The name of the property which holds the User property set to lookup the user's email address

OPT_IN_PROPERTY_SET_KEY

public static final java.lang.String OPT_IN_PROPERTY_SET_KEY
The name of the property set which holds the email opt-in property

OPT_IN_PROPERTY_NAME_KEY

public static final java.lang.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

SUBJECT_PARAM

public static final java.lang.String SUBJECT_PARAM
parameter key for the mail subject

MESSAGE_TEXT_PARAM

public static final java.lang.String MESSAGE_TEXT_PARAM
parameter key for the message text

FROM_PARAM

public static final java.lang.String FROM_PARAM
parameter key for the from address

TO_PARAM

public static final java.lang.String TO_PARAM
parameter key for the to address

JSP_URI

public static final java.lang.String JSP_URI
parameter key for the URI of a JSP to use to generate the message

JSP_PARAMS

public static final java.lang.String JSP_PARAMS
parameter key for a map of JSP parameters to pass

MESSAGE_HEADERS

public static final java.lang.String MESSAGE_HEADERS
parameter key for a map of mail headers

BATCH_MODE

public static final java.lang.String BATCH_MODE
parameter key to flag batch-mode (defaults to true)

GLOBAL_BATCH

public static final java.lang.String GLOBAL_BATCH
global batch name (if none is provided)

USER_ID_JSP_PARAM

public static final java.lang.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.

CONTAINER_ID_JSP_PARAM

public static final java.lang.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 java.lang.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.

SCENARIO_ID_JSP_PARAM

public static final java.lang.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 java.lang.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.
Constructor Detail

MailAction

public MailAction()
Method Detail

run

public void run()
         throws ActionException
Run the Action; in this case, create an email based on the parameters received in the init() method.
Overrides:
run in class Action
Following copied from class: com.bea.commerce.campaign.action.Action
Throws:
ActionException - will be thrown if an error occurs

init

public void init(java.util.Map params)
          throws java.lang.IllegalArgumentException
Initialize the MailAction so that it can generate and batch a message.

Parameters are:

Overrides:
init in class Action
Following copied from class: com.bea.commerce.campaign.action.Action
Parameters:
params - A map of name/value pairs
Throws:
java.lang.IllegalArgumentException - if any required params are missing

getMailService

protected MailService getMailService()
                              throws java.lang.Exception

© 2001 BEA Systems, Inc.

Copyright © 2001 BEA Systems, Inc. All Rights Reserved