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 storeId. The
storeId is the value located in the STOREENT_ID
column of the STOREENT database table. To determine the storeId:
- Connect to the WebSphere Commerce database.
- Run the following command:
select storeent_id, identifier from storeent
Procedure
- Open
WebSphere Commerce Developer and switch to the Enterprise Explorer
view.
- Open the Struts configuration file for
the store in an editor.
The file is stored at this path:
WCDE_installdir /workspace/Stores/WebContent/WEB-INF/struts-config-ext.xml
- Add the following
<forward>
element
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 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>
- Save and close the struts-config-ext.xml file
- Access
the development database.
- Run the following SQL statement:
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 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: