Develop > Presentation layer > Customize marketing > E-mail activities and custom activity template JSP files


Develop the content of a custom e-mail template JSP file

You can develop dynamic and personalized e-mail message content for the custom e-mail template JSP file. When developing the content, adhere to certain specification rules.

In order to receive e-mail activities, the customer must have opted in for marketing e-mails during store registration or account updates. The EmailActivityUrlHelperDataBean class gives customers a quick opt-out method.

The content of an e-mail message is separated from the address (both the sender and recipient) and subject elements of the message. A typical example of a MIME e-mail message header follows:

    Received: from localhost (localhost)
    by some.address.com (1.12.256/1.12.256) id g8UG02Hj033414;     Tue, 22 Oct 2002 14:43:22 -0400
    Date: Tue, 22 Oct 2002 14:43:22 -0400
    From: Mail Delivery Subsystem

<MAILER-DAEMON@some.address.com>     

Message-Id: <200209301843.g8UG02Hj033414@some.address.com>     
To: <yourname@anotherAddress.com>     
MIME-Version: 1.0 Content-Type: multipart/report; 
report-type=delivery-status;     
boundary="g8UG02Hj033414.1033411402/some.address.com"
Subject: Returned mail: see transcript for details --g8UG02Hj033414.1033411402/some.address.com
The original message was received at Tue, 22 Oct 2002 13:57:55
-0400 from 
    yet.another.address.com [256.256.256.256]

As can be seen from the areas marked in bold, the content of the e-mail is distinctly separate from the header information. This separation influences software APIs and products that are developed using these e-mail formats.

When creating an e-mail template, adhere to the following specification rules:


Procedure

  1. If the URL query string requesting the JSP page contains the "returnSubject=true" parameter, then the JSP page should render only what would be on the subject line of the e-mail message.

  2. If the URL query string requesting the JSP page does not contain the "returnSubject=true" parameter (that is, it is set to anything but "true", or does not exist), then the JSP page should render the content of the e-mail message, except for the subject line data.

  3. The URL query string registered as part of an e-mail template must have the following parameters added during the request:

    recipientId

    The userID of the user for whom to generate the e-mail.

    storeId

    The store entity ID of the store for this e-mail template.

    activityId

    The ID of the e-mail activity that made this request.

    These parameters are populated during e-mail creation.

  4. If you are using Coremetrics analytics for e-mail activities, and a link points to the store front, it has to include the cm_cr and cm_mmc parameters, appended to the URL. They have the format:

     
    cm_cr=OS: Campaign Name-_-E-mail Activity-_- E-mail Activity Name-_- E-mail Template Name-_- Link Name 
    cm_mmc=E-mail-_-Websphere Commerce-_- E-mail Activity Name-_- Link Name 
     
    where  E-mail Activity Name is the name of the e-mail activity,  E-mail Template Name is the name of the e-mail template, and  Link Name is the name of the link, uniquely identifying the link within the template. 
     
    
    

    For example: https://hostname/webapp/wcs/stores/servlet/ProductDisplay?storeId=10001&catalogId=10001&productId=10001& cm_cr=OS:No+Campaign-_-E-mail+Activity-_-Summer+Discount+Activity-_-Show+Promotion-_-Desk+Special&cm_mmc=E-mail-_-WebSphere+Commerce-_-Summer+Discount+Activity-_-Desk+Special


Results

When a URL is registered to the e-mail template, it requests various resources. By conforming to the preceding rules, you ensure that these resources provide dynamic, e-mail messages. Since all parameter data is passed by way of the URL query string, the receiving URL need not be a JSP. In fact, any resources that can read and respond according to the preceding rules can be considered valid e-mail templates. In practice, however, it can be much more difficult to achieve the same rich content as produced by JSP files running within the WebSphere Commerce product.


Related concepts

E-mail activities and custom activity template JSP files


Related tasks

Register a custom e-mail activity template

Register a custom e-mail activity template

Related reference

Sample JSP code: e-mail template

E-mail activity delivery algorithm


+

Search Tips   |   Advanced Search