Enabling and configuring the SMS transport
Enabling the Short Message Service (SMS) transport
extends cross-channel access by offering mobile device capabilities
in HCL Commerce. Mobile messaging enhances the shopper's
access to information by providing access through their mobile device.
About this task
This task enables and configures the SMS transport in
HCL Commerce using the Administration Console. The steps involved
in this task include:
- Adding an SMS transport to the site, if necessary, using the Administration Console transports.
- Creating and configuring a message type using the Administration Console message types.
- Mapping the message type to a JSP file by editing the struts-config.xml configuration file.
Procedure
- Open the Administration Console and select Site or Store, on the Administration Console Site/Store Selection page.
- Click .
- The SMS-HTTP and SMS-WS transports
should appear in the list and as active.
- Select the check box next to the SMS transport and click Configure.
- Complete the values for the parameters corresponding to the SMS transport you created. See Configuration of transport services used for a message for a description of these values. Click OK.
- Click .
- Click New.
- From the Message Type list, select
a message type.To send marketing text messages using a Dialog activity, select Marketing message.
- Specify a message severity range. In general, a message severity of 0,0 is recommended.
- From the Transport list, select SMS-HTTP or SMS-WS.
- From the Device format list, select SMS messages.
- Click Finish. The Message Type Configuration
page displays. The Transport Status Column should be Active. If the
transport status is not active, then the transport has been deactivated,
or removed. Note: You might encounter the following error if the Message Type is not completely configured:
To avoid this issue, ensure that you complete all the preceding Message Type configuration steps.CMN8413E: The messaging system cannot find an appropriate profile for MSGTYPE_ID "350"
- Optional: Modify the Struts configuration file
if you want to customize the mapping of the message template to another
JSP file. For marketing text messages, you can skip this step because
these text messages are created in the Marketing tool as content.
Results
After completing the preceding steps in order, you have:
- Added an SMS transport to the site using the Administration Console transports.
- Created and configured a message type using the Administration Console message types.
- Optional: Mapped the message type to a JSP file by editing the struts-config.xml configuration file.
Example
A sample mapping is created between the SMS transport and the sample OrderReceivedSMS.jsp file.
- Complete steps 1 through 14, based on the OrderReceived message type for the SMS transport.
- Create a new OrderReceivedSMS.jsp file with the following sample
content:
<%@ page import="com.ibm.commerce.command.*" %><%@ page import="com.ibm.commerce.common.objects.*" %><%@ page import="com.ibm.commerce.server.*" %> <% try { JSPHelper jhelper = new JSPHelper(request); String orderId = jhelper.getParameter("orderId"); CommandContext commandContext = (CommandContext)request.getAttribute(ECConstants.EC_COMMANDCONTEXT); StoreAccessBean storeAB = commandContext.getStore(); StoreEntityDescriptionAccessBean storeEntDescAB = storeAB.getDescription(new Integer(storeAB.getLanguageId())); String storeName = storeEntDescAB.getDisplayName(); out.println("Thank you for shopping at "+ storeName + ". We received your order, number " + orderId + "."); } catch (Exception e) { out.println(e); } %>
- Open the struts-config.xml configuration file and insert the following
code snippet:
<forward className="com.ibm.commerce.struts.ECActionForward" name="OrderReceivedView/0/-7" path="/OrderReceivedSMS.jsp"> <set-property property="resourceClassName" value="com.ibm.commerce.messaging.viewcommands.MessagingViewCommandImpl"/> <set-property property="properties" value="storeDir=no"/> <set-property property="interfaceName" value="com.ibm.commerce.messaging.viewcommands.MessagingViewCommand"/> <set-property property="implClassName" value="com.ibm.commerce.messaging.viewcommands.MessagingViewCommandImpl"/> <set-property property="direct" value="true"/> </forward>
In this example, the -7 value represents the SMS device format as defined in the DEVICEFMT database table, and maps the OrderReceived view to the OrderReceivedSMS.jsp file.
- Save the struts-config.xml configuration file. The sample OrderReceivedSMS.jsp file is now mapped to the OrderReceived view for the SMS transport.