Administer > Manage WebSphere Commerce features > Messaging system > Work with message types


Configure the SMS transport

Enable the Short Message Service (SMS) transport extends cross-channel access by offering mobile device capabilities in WebSphere Commerce. Mobile messaging enhances the shopper's access to information by providing access through their mobile device.

This task enables and configures the SMS transport in WebSphere Commerce using the Administration Console. The steps involved in this task include:


Procedure

  1. Open the Administration Console and select Site or Store, on the Administration Console Site/Store Selection page.

  2. Click Configuration > Transports.

  3. The SMS-HTTP and SMS-WS transports should appear in the list and as active.

    1. If the transport to configure does not appear in the transport list:

      1. Click Add to open the Add Transport page.

      2. Select the check box next to the SMS transport to add to the site.

      3. Click Add to accept the changes. When you add a transport method to a site, it is automatically activated.

    2. If the transport to configure is inactive:

      1. Select the check box next to the inactive transport.

      2. Click Change Status.

      3. The transport status should change from Inactive to Active.

  4. Select the check box next to the SMS transport and click Configure.

  5. 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.

  6. Click Configuration > Message Types.

  7. Click New.

  8. From the Message Type list, select a message type.

    To send marketing text messages using a Dialog activity, select Marketing message.

  9. Specify a message severity range. In general, a message severity of 0,0 is recommended.

  10. From the Transport list, select SMS-HTTP or SMS-WS.

  11. From the Device format list, select SMS messages.

  12. 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.

  13. Optional: Modify the Struts configuration file 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.

    1. Open the struts-config.xml configuration file and add a new entry for the SMS message type you created. For example:

      <forward className="com.ibm.commerce.struts.ECActionForward"
                  name="yourView/0/-7" path="/yourJSPfile.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>
      

      The configuration file uses -7 as the SMS device format, as defined in the DEVICEFMT database table. The path parameter in the new entry is mapped to a JSP file.

    2. Save the changes and close the configuration file.

  14. Restart the WebSphere Commerce server to apply the changes.


Results

After completing the preceding steps in order, you have:

  1. Added an SMS transport to the site using the Administration Console transports.

  2. Created and configured a message type using the Administration Console message types.

  3. 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.

  1. Complete steps 1 through 14, based on the OrderReceived message type for the SMS transport.

  2. 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 the order, number " + orderId + "."); } 
    catch (Exception e)
    {
        out.println(e); }
    %>
    

  3. 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.

  4. Save the struts-config.xml configuration file. The sample OrderReceivedSMS.jsp file is now mapped to the OrderReceived view for the SMS transport.


Related concepts

Madisons mobile starter store

SMS transport integration

Related reference

Configuration of transport services used for a message


+

Search Tips   |   Advanced Search