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
Procedure
- Open IBM WebSphere Commerce Developer and switch to the Enterprise Explorer view.
- Expand .
- Open the struts-config-ext.xml file for editing.
-
Add the following
<forward>element configuration to the struts-config-ext.xml file:
Where:<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>template_viewis the Struts view name for identifying the custom email template.storeIdis the store ID as defined in the STORE_ID column of the STOREENT database table. Use-3as shown. This value specifies the email transport.template_pathis 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> - Save and close the struts-config-ext.xml file
-
Connect to your development environment database and run the following SQL statement to
register the template.
Where:INSERT INTO EMLMSG (EMLMSG_ID, STOREENT_ID, JSPPATH, NAME, STATUS, EMLBODYTYPE, PROPERTYFILE) VALUES (emlmsg_id, storeId, 'template_view', 'template_name', 1, 0, '');emlmsg_idis a numeric ID that you assign to the email message, for example,10.storeIdis the store ID as defined in the STORE_ID column of the STORE table.template_viewis the Struts view name for identifying the custom email template. This name must match thetemplate_viewname that you specified in the<forward>element.template_nameis 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, ''); - Restart the WebSphere Commerce Test Server for your changes to take effect.
- Deploy your changes to the production server.