Technote

(troubleshooting)
Email Templates generated using HTML has "null" content
Problem(Abstract)
When you create e-mail templates to use with e-mail campaigns in WebSphere Commerce Accelerator, you have the choice of using HTML or plain text. This technote deals with issues encountered when using HTML such as no content generated when previewing the template or unwanted line breaks introduced in the generated content.. Screenshots are included to show a description of the problem,
Symptom The following two issues may show in the preview pane:
1. No content generated:
The preview pane will be similar to the following screenshot:



2. Unexpected line breaks in the template.
The content is generated, however you have unexpected line breaks in the page. The first screenshot below shows the intended result.



The next screenshot shows line breaks introduced in the page. You may encounter this problem once you bring your html in the editor:

Cause These issues happen due to strict HTML checking in place in the template editor. A couple of rules must be followed to make sure the content is generated properly.
Issue 1: This occurs if you have incorrectly coded HTML. For instance, your HTML for an img tag should look like:


Notice the forward slash at the end of the tag. This is the proper way to close a tag that doesn't have an </img> closing tag. This is also known as creating an empty element tag. Most editors do not require strict usage of empty element tags such as <img> and <br>. This is acceptable as long as there are no WebSphere Commerce generated links after using this closing tag. However, if you leave a tag unclosed, and have an auto generated link (by selecting available options such as display a product, or unsubscribe) after it, you will get a null content page.
WebSphere Commerce generated links look like:



Issue 2:
This will happen if your initial HTML opening tag in the template is not capitalized. Resolving the problem In order to resolve the above issues, use the following checklist:

  1. Issue 1, ensure that you thoroughly check your html to make sure there are no image tags that close as the in the example above. An easy way of finding this issue, is to use a small HTML page code that just shows an image followed by a WebSphere Commerce generated links as in the example below:
    Sample code for testing your image tags:
    <HTML>
     <A HREF="http://localhost>
      /webapp/wcs/stores/servlet/TopCategoriesDisplay?
      langId=-1&storeId=10001&catalogId=10001 <img src="   
      http://localhost/wcsstore/ConsumerDireimages/    catalog/FU.jpg"> </A>
      <e-mail:Link text="click here"
      url="http://www.localhost.com"  
      emailaction="2" type="unsubscribe" />
    </HTML>

    Replace the URL in the HREF tag, the image link and the URL in the unsubscribe action with URLs pertaining to your store. With the template in place, cycle through your image links by replacing the one in the template and preview them. If you have a null page, there is a problem with the closing tags. Clean up the tags by removing unwanted slashes and so on and try again.

  2. Issue 2:
    You must ensure that the HTML opening and closing tags at the start or end of your template are both using upper case characters. So you should use <HTML> and </HTML> rather than <html> and <html>. If these tags are lower case, the editor will NOT recognize them and your html code will be parsed as plain text which is why every time you have a carriage return in the HTML text, it will be considered as a real carriage return since it is being interpreted as plain text.

 

Document Information

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