Registering a custom email activity template

By registering a custom email activity template, you make the template available to business users within the Marketing tool. To register a custom template, update the Struts configuration file for your store and the WebSphere Commerce database to include your custom template in the list of available templates.

Before you begin

Ensure that you know the storeId value for your store. This value is stored within the STOREENT.STOREENT_ID database column.

Procedure

  1. Open IBM WebSphere Commerce Developer and switch to the Enterprise Explorer view.
  2. Expand Stores > WebContent > WEB-INF.
  3. Open the struts-config-ext.xml file for editing.
  4. Add the following <forward> element configuration to the struts-config-ext.xml file:
    
    <forward className="com.ibm.commerce.struts.ECActionForward" 
     name="template_view/storeId/-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 for identifying the custom email template.
    • storeId is the store ID as defined in the STORE_ID column of the STOREENT database table. Use -3 as shown. This value specifies the email transport.
    • template_path is the path to the custom email template JSP file.
    For example, the following forward configuration configures an email template JSP for an activity related to sending emails about abandoned shopping carts.
    
    <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> 
  5. Save and close the struts-config-ext.xml file
  6. Connect to your development environment database and run the following SQL statement to register the template.
    
    INSERT INTO EMLMSG (EMLMSG_ID, STOREENT_ID, JSPPATH, NAME, STATUS, EMLBODYTYPE, PROPERTYFILE) 
    VALUES (emlmsg_id, storeId, 'template_view', 'template_name', 1, 0, '');
    
    Where:
    • emlmsg_id is a numeric ID that you assign to the email 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 for identifying the custom email template. This name must match the template_view name that you specified in the <forward> element.
    • template_name is the name for the custom email template that displays in Management Center to business users.
    For example,
    
    INSERT INTO EMLMSG (EMLMSG_ID, STOREENT_ID, JSPPATH, NAME, STATUS, EMLBODYTYPE, PROPERTYFILE) 
    VALUES (10, 10101, 'AbandonedCartEmail', 'Reminder for abandoned carts', 1, 0, '');
    
  7. Restart the WebSphere Commerce Test Server for your changes to take effect.
  8. Deploy your changes to the production server.