The TemplateEmailInfoImpl’s contentProcessor property points to a MessageContentProcessor object, which is responsible for actually setting the e-mail message content given the rendered message body. Implementing this functionality in a separate class allows you to implement different schemes for processing content.

MessageContentProcessor is an abstract class. The Personalization module includes two concrete subclasses of MessageContentProcessor: SimpleContentProcessor and HtmlContentProcessor. You can also implement your own content-processing scheme by creating a subclass of MessageContentProcessor that implements all of its methods.

SimpleContentProcessor

SimpleContentProcessor doesn’t do any processing on the passed-in message content but simply uses the content as is to set the javax.mail.Message content. The MIME type of the content in the Message is specified by the service’s contentType property. For instance, if contentType is “text/html,” the rendered page is sent as HTML; if the contentType is “text/plain,” it will be sent as simple text (no word wrapping).

HtmlContentProcessor

HtmlContentProcessor is a more sophisticated implementation of MessageContentProcessor. The HtmlContentProcessor does the following:

You can configure the HtmlContentProcessor with the following properties:

Property

Function

Default

sendAsHtml

If true, send message as HTML; if sendAsText is also true, send as multipart/alternative with text/plain and text/html parts.

true

sendAsText

If true, send message as plain text; if sendAsHtml is also true, send as multipart/alternative with text/plain and text/html parts.

true

indentWidth

Indentation width used in text/plain version of message.

5

lineWidth

Line width used in text/plain version of message.

70

hrChar

Character to use to create horizontal rules in text/plain version of message.

-

liChar

Character to use to introduce list items in text/plain version of message.

-

HtmlToTextConverter

If the sendAsText property in HtmlContentProcessor is true for a given e-mail message, the Personalization module uses an instance of the class atg.userprofiling.email.HtmlToTextConverter to convert the message to plain text. Note, however, that the converter supports the conversion of content included in the following HTML tags only:

title
h1
h2
h3
h4
h5
h6
p
br
hr
blockquote
pre
ul
ol
li

See also Sending Message Content as Both Text and HTML.


Copyright © 1997, 2013 Oracle and/or its affiliates. All rights reserved. Legal Notices