Develop > Presentation layer > Customize marketing > E-mail activities and custom activity template JSP files


Register a custom e-mail activity template

By registering a custom e-mail activity template in a Struts configuration file and the WebSphere Commerce database, you make the template available to business users in either the Management Center Marketing tool or WebSphere Commerce Accelerator. This task adds the custom template to the list of e-mail templates for marketing e-mails.


Before you begin

Ensure that you know the . The is the value located in the STOREENT_ID column of the STOREENT database table.

To determine the :

  1. Connect to the WebSphere Commerce database.

  2. Run the following command:

    select storeent_id, identifier from storeent


Procedure

  1. Open WebSphere Commerce Developer and switch to the Enterprise Explorer view.

  2. Open the Struts configuration file for the store in an editor. The file is stored at this path:

    /workspace/Stores/WebContent/WEB-INF/struts-config-ext.xml

  3. Add the following <forward> element to the struts-config-ext.xml file:

    <forward className = "com.ibm.commerce.struts.ECActionForward"
             name = "template_view//-3"
             path = "template_path">    
    
    <set-property property = "interfaceName" 
                  value = "com.ibm.commerce.messaging.viewcommands.MessagingViewCommand"/>    
    
    <set-property property = "implClassName" 
                  value = "com.ibm.commerce.messaging.viewcommands.MessagingViewCommandImpl"/>
    </forward>
    

    Where:

    template_view

    is the Struts view name you assign to identify the custom e-mail template

    storeId

    is the store ID as defined in the STORE_ID column of the STORE table

    Use -3 as shown; this value specifies the e-mail transport.

    template_path

    is the path to the custom e-mail template JSP file

    Here is an example:

    <forward className="com.ibm.commerce.struts.ECActionForward"    
             name="AbandonedCartEmail/10101/-3" 
             path="/include/AbandonedCart.jsp">    
    
    <set-property property="interfaceName" 
                  value="com.ibm.commerce.messaging.viewcommands.MessagingViewCommand"/>    
    
    <set-property property="implClassName" 
                  value="com.ibm.commerce.messaging.viewcommands.MessagingViewCommandImpl"/>
    </forward> 
    

  4. Save and close the struts-config-ext.xml file

  5. Access the development database.

    1. Run the following SQL statement:

      INSERT INTO EMLMSG (EMLMSG_ID, STOREENT_ID, JSPPATH, NAME, STATUS, EMLBODYTYPE, PROPERTYFILE) 
      VALUES (emlmsg_id, , 'template_view', 'template_name', 1, 0, '')
      

      Where:

      emlmsg_id

      is a numeric ID that you assign to the e-mail message, for example, 10.

      storeId

      is the store ID as defined in the STORE_ID column of the STORE table

      template_view

      is the Struts view name you assign to identify the custom e-mail template. This name must match the template_view name you specified in the <forward> element in step 3.

      template_name

      is a name you give to the custom e-mail template that will display in the Management Center to business users.

      Here is an example:

      INSERT INTO EMLMSG (EMLMSG_ID, STOREENT_ID, JSPPATH, NAME, STATUS, EMLBODYTYPE, PROPERTYFILE) 
      VALUES (10, 10101, 'AbandonedCartEmail', 'Reminder for abandoned carts', 1, 0, '')
      


What to do next

Decide whether to do the following now or after you have made additional changes in the development environment to support your e-mail template:


Related tasks

Develop the content of a custom e-mail template JSP file

Related reference

Sample JSP code: e-mail template

E-mail activity delivery algorithm


+

Search Tips   |   Advanced Search