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 HCL Commerce database to include your custom template in the list of available templates.
Before you begin
Procedure
- Open HCL Commerce Developer and switch to the Enterprise Explorer view.
-
Locate the customized struts configuration.
- Expand .
- Expand .
-
Open the configuration file for editing.
- struts-config-ext.xml
- struts-wcs-stores-custom.xml
-
Add the email template mapping to the struts configuration file.
- 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_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.
<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>
- Add the following
<result>
element configuration to the struts-wcs-stores-custom.xml file:
Where:<result name="template_view/storeId/-3" type="wcsstore"> <param name="location">template_path</param> <param name="interfaceName">com.ibm.commerce.messaging.viewcommands.MessagingViewCommand</param> <param name="implClassName">com.ibm.commerce.messaging.viewcommands.MessagingViewCommandImpl </param> </result>
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.
<result name="AbandonedCartEmail/10101/-3" type="wcsstore"> <param name="location">/include/AbandonedCart.jsp</param> <param name="interfaceName">com.ibm.commerce.messaging.viewcommands.MessagingViewCommand</param> <param name="implClassName">com.ibm.commerce.messaging.viewcommands.MessagingViewCommandImpl </param> </result>
- Add the following
- Save and close the struts-config-ext.xml file (Version 9.0.0.x), or the struts-wcs-stores-custom.xml file (Version 9.0.1+).
-
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_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 thetemplate_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, '');
- Restart the HCL Commerce Test Server for your changes to take effect.
- Deploy your changes to the production environment.