Adding support for personalized text in an e-Marketing Spot
You can add support for substitution variables by customizing JSP files for store pages that contain e-Marketing Spots. Business users can then personalize the text that customers see displayed in the e-Marketing Spot, for example, by substituting a customer's name into a text string.
About this task
Procedure
- Define the variable text to display to the customer
in
the e-Marketing Spot and assign an identifier to each piece of variable
text.
For example, you might want to display the following text:
Hi [FirstName], welcome back!
In this example, the identifier assigned to the variable text is
[FirstName]
. - Edit the JSP file for the store page containing the e-Marketing Spot in which you want to display variable text.
- Within
the JSP file, locate the
<c:import
tag for the specific e-Marketing Spot. - For each
piece of variable text that must be defined, add
code within the
<c:import
tag that uses the following syntax:<c:param name="substitutionName1" value="[parameterName1]" /> <c:param name="substitutionValue1" value="parameterValue1" />
Where:- [parameterName1] is the identifier for the variable text.
- parameterValue1 is the text to replace in the content.
For example, to substitute the customer's first name in a text string, the lines of code to add to the JSP file might look like those shown below in bold text:
<wcf:getData type="com.ibm.commerce.member.facade.datatypes.PersonType" var="person" expressionBuilder="findCurrentPerson"> <wcf:param name="accessProfile" value="IBM_All" /> </wcf:getData> <c:import url="${jspStoreDir}include/WebServiceeMarketingSpotDisplay.jsp"> <c:param name="emsName" value="HelpPage" /> <c:param name="substitutionName1" value="[FirstName]" /> <c:param name="substitutionValue1" value="${person.contactInfo.contactName.firstName}" /> </c:import>
In the previous example, the first three lines use the Get Person service to retrieve information about the current customer.
- Save and close the JSP file.
- Deploy the updated JSP file.
What to do next
Hi [FirstName], welcome back!