Technote

(FAQ)
Configure WebSphere Commerce to send e-mail notification to guest shoppers
How do you send an e-mail notification to guest shoppers of your WebSphere Commerce store?


Answer

This technote describes how to enable the following e-mail notifications for guest shoppers:

  1. Order Received

  2. Order Authorized

  3. Order Cancelled

  4. Order Shipped - APAR LI70699 REQUIRED (LI70699 is included in 5.6.1 and Fix Pack 5.6.0.5 for 5.6.0)


Prerequisites

Verify that the following tasks are completed (more details in additional information section):

  1. In Administration Console, under Configuration> Transports, the e-mail transport must be set up.

  2. In Administration Console, under Configuration> Message Types, the following message types must be set up:

    • Message for a received order

    • Message for a authorized order

    • Notification message for a cancelled order

    • Message for notifying the customer of an order release manifestation


If your ConsumerDirect modelled store was published before a fix pack was applied to the product, follow the instruction set for case A.
If your ConsumerDirect modeled store was published after a fix pack was applied to the product, follow the instruction set for case B.

Instruction set for case A:

  1. Locate the AddressEntryForm.jspf file in the following location: <WebSphere_install_dir>/AppServer/installedApps/<hostname>/
    WC_<instance>.ear/Stores.war/<store_name>/UserArea/
    AccountSection/AddressbookSubsection/AddressEntryForm.jspf

  2. Modify the AddressEntryForm.jspf file to include a mandatory field for the e-mail address:   
    <tr>
      <td align="right" valign="middle"
         id="WC_AddressEntryForm_TableCell_19">
         <span class="strongRedText">*</span>
         <span class="strongtext"><fmt:message key="EMAIL"
            bundle="${storeText}" /></span>
      </td>
     <td valign="middle" colspan="3"
         id="WC_AddressEntryForm_TableCell_20">
         <input size="38" maxlength="128" type="text"
         name="email1" value='<c:out
         value="${paramSource.email1}"/>'
            id="WC_AddressEntryForm_FormInput_email1_1"/>
      </td>
    </tr>

  3. Locate the OrderSubmitForm.jsp file from the following location: <WebSphere_install_dir>/AppServer/installedApps/<hostname>/
    WC_<instance>.ear/Stores.war/<store_name>/ShoppingArea/
    CheckoutSection/StandardCheckoutSubsection/OrderSubmitForm.jsp

  4. Modify the OrderSubmitForm.jsp file to retrieve the e-mail address entered into AddressEntryForm by making the following changes:

    1. Declare an e-mail variable in the variable declaration area: 
      String strEmail = "";

    2. Retrieve the e-mail address: 
      strEmail = billingAddressDisplay.getEmail1();

    3. Display the e-mail address in the order summary:
      <%=strEmail%><br/>

  5. Modify the OrderSubmitForm.jsp to send an e-mail notification by completing the following steps (instructions can be found on the WebSphere Commerce Information Center http://publib.boulder.ibm.com/infocenter/wc56help/topic/com.ibm.
    commerce.developer.doc/refs/rosorderprocess.htm
    ):

    1. Search for emailShopper and modify the value to "1" in the following piece of code:

      if (userType.equalsIgnoreCase("G"))
      {
          //This is a guest user. Do not send e-mail.
          emailShopper = "1"  
          //This value is originally set to 0
      }

      If the above value is set to "0" the guest shopper will not receive the notification e-mails.

    2. Add the following lines after the changes made in Step i to enable the e-mail notifications to be sent to the guest shopper. Ensure the INPUT tags below are within the appropriate form tag, for example the OrderProcess form:

      <input type="hidden"
      name="notify_OrderReceived_EMailSender_recipient"
      value="<%= strEmail %>" />
      <input type="hidden"
      name="notify_OrderAuthorized_EMailSender_recipient"
      value="<%= strEmail %>" />
      <input type="hidden"
      name="notify_OrderCancel_EMailSender_recipient"
      value="<%= strEmail %>" />
      <input type="hidden"
      name="notify_ReleaseShipNotify_EMailSender_recipient"
      value="<%=strEmail %>" />


Instruction set for case B:

  1. Locate the AddressEntryForm.jspf in the following location:
    <WebSphere_Install_Dir>/AppServer/installedApps/<hostname>/
    WC_<instance>.ear/Stores.war/ConsumerDirect/Snippets/
    ReusableObjects/AddressEntryForm.jspf

  2. Modify the AddressEntryForm.jspf to include a mandatory field for the e-mail address:
    <tr>
     <td align="right" valign="middle"
        id="WC_AddressEntryForm_TableCell_19">
     <span class="strongRedText">*</span>
     <span class="strongtext"><fmt:message key="EMAIL"
     bundle="${storeText}" /></span>
     </td>
    <td valign="middle" colspan="3"
        id="WC_AddressEntryForm_TableCell_20">
    <input size="38" maxlength="128" type="text"
        name="email1" value='<c:out
        value="${paramSource.email1}"/>'
        id="WC_AddressEntryForm_FormInput_email1_1"/>
    </td>
    </tr>

  3. Locate the Address.jspf file in the following location: <WebSphere_Install_Dir>/installedApps/<hostname>/
    WC_<instance>.ear/Stores.war/<storeName>/
    Snippets/ReusableObjects/Address.jspf

  4. Modify the Address.jspf file to retrieve and display the e-mail address entered into
    AddressEntryForm.jspf by adding the following line immediately after the last <c:out....> tag:

    <c:out value="${address.email1}"/><br/>

  5. Locate the OrderSummaryDisplay.jspf file in the following location:
    <WebSphere_Install_Dir>/installedApps/<hostname>/
    WC_<instance>.ear/Stores.war/<Store_Name>/
    include/OrderSummaryDisplay.jspf

  6. Modify OrderSummaryDisplay.jspf to send e-mail notifications by completing the following steps:

    1. Search for emailShopper and modify the value to 1 in the following piece of code:

      <c:if test="${userType eq 'G'}">
            <c:set var="emailShopper" value="1" />
      </c:if>

      Alternatively, you can comment out the above code.

    2. Add the following lines after the changes made in Step i to enable the e-mail notifications to be sent to the guest shopper:

      <input type="hidden"
      name="notify_OrderReceived_EMailSender_recipient"
      value="<c:out value="${address.email1}"/>"/>
      <input type="hidden"
      name="notify_OrderAuthorized_EMailSender_recipient"
      value="<c:out value="${address.email1}"/>"/>
      <input type="hidden"
      name="notify_OrderCancel_EMailSender_recipient"
      value="<c:out value="${address.email1}"/>"/>
      <input type="hidden"
      name="notify_ReleaseShipNotify_EMailSender_recipient"
      value="<c:out value="${address.email1}"/>/>




Additional Information:

For the changes in the JSP page to be effective, the following compiled versions will have to be deleted from the <WAS_Install_Dir>/temp/<NodeName>/<WC_Instance_name>/
<WC_Instance_name>/Stores_war/<Store_Name>/ShoppingArea/
CheckoutSection/StandardCheckoutSubsection/
directory:


Enabling shipment notification e-mails:
http://publib.boulder.ibm.com/infocenter/wc56help/topic/com.ibm.
commerce.integration.doc/tasks/tmxenshpn.htm



Configuring a transport method for the site:
http://publib.boulder.ibm.com/infocenter/wc56help/topic/com.ibm.
commerce.admin.doc/tasks/tcvscnftr.htm


Assigning a message type to a transport method for a site or store:
http://publib.boulder.ibm.com/infocenter/wc56help/topic/com.ibm.
commerce.admin.doc/tasks/tcvsastrn.htm
Cross Reference information
Segment Product Component Platform Version Edition
Commerce WebSphere Commerce Professional Edition Customization / Application Development AIX, i5/OS, Linux, Solaris, Windows 5.6.1, 5.6.1.1, 5.6.1.2, 5.6.1.3, 6.0, 6.0.0.1, 6.0.0.2, 6.0.0.3, 6.0.0.4
Commerce WebSphere Commerce - Express Customization / Application Development AIX, i5/OS, Linux, Solaris, Windows 5.6.1, 5.6.1.1, 5.6.1.2, 5.6.1.3, 6.0, 6.0.0.1, 6.0.0.2, 6.0.0.3, 6.0.0.4
Commerce WebSphere Commerce Business Edition Customization / Application Development AIX, i5/OS, Linux, Solaris, Windows 5.6, 5.6.1, 5.6.1.1, 5.6.1.2, 5.6.1.3
   

Document Information

Current web document: http://www.ibm.com/support/docview.wss?uid=swg21230937