You create targeted e-mail using the class. This class draws the message body of an e-mail from a page template, invokes a MessageContentProcessor component to process the content, and then passes the resulting JavaMail object to the TemplateEmailSender component, which sends the message. The properties of a TemplateEmailInfoImpl object store values that are specific to an individual e-mail campaign, so you should create a separate instance of this class for each campaign.

You can use targeted e-mail to produce e-mail messages that are personalized for different profiles. The e-mail content is based on a JSP or JHTML template, specified with the templateURL property of a TemplateEmailInfoImpl object. Using the dynamic elements of the Page template, you can customize the e-mail for each of your users according to their profile attributes. For example, a JHTML page template might read:

<importbean bean="/atg/userprofiling/Profile">

<p>Dear <valueof bean="Profile.firstName">Customer</valueof>,
<p>We're writing to tell you about some exciting new offers ...


Here is the same example in a JSP template:

<dsp:importbean bean="/atg/userprofiling/Profile"/>

<p>Dear <dsp:valueof bean="Profile.firstName">Customer</dsp:valueof>,
<p>We're writing to tell you about some exciting new offers ...


The template yields different message text depending on the attributes of the recipient’s profile. You can use ATG’s targeting servlet beans to personalize the content of the message as well. If the template page contains a targeting servlet bean, the servlet bean behaves just as it would in any other page, rendering content targeted to the current profile.

The TemplateEmailInfoImpl object contains the standard e-mail message attributes as properties. When it invokes the createMessage method, the specified e-mail attributes create and fill in a javax.mail.Message object, which can then be sent to the desired recipient using the TemplateEmailSender service, described in the next section.

The following table describes key properties of the TemplateEmailInfoImpl class:




Specifies the URL of a template containing a text version of an HTML message. See Sending Message Content as Both Text and HTML.


Enables distributed mailing features for this mailing. See Distributing a Mailing across Multiple Servers.


The URL of the template page.

Example: templateURL=/en/email/newfund.jsp

If the template contains links to other URLs on your site, you must specify them as absolute URLs in order for the email recipients to be able to access the linked pages. Use the full http://server:port/... form of the URL, for example <img src="http://myserver:80/images/logo.gif> rather than <img src="images/logo.gif> and <a href="http://myserver:80/help/index.html>help</a> rather than <a href="help/index.html>help</a>.


A name used to identify an e-mail campaign

Default: Tuesday meeting


“From” field of the e-mail message



A single e-mail address that overrides the emailAddress property of the target profile



“Reply to” field of the e-mail message



“Cc” field of the e-mail message



“Bcc” field of the e-mail message



“Subject” field of the e-mail message

Default: Mandatory Meeting, Tuesday at 3:00


Any files to attach to the e-mail message

Default: E:/mailattach/agenda.doc


MessageContentProcessor responsible for processing the message content

Default: /atg/userprofiling/email/HtmlContentProcessor


Overrides the properties set in a JHTML or JSP file and fills the e-mail with values from an e-mail template

Default: true

Note that TemplateEmailInfoImpl is a subclass of the abstract class TemplateEmailInfo. If you want to create your own template e-mail implementation, you can create a subclass of TemplateEmailInfo that implements all of its methods, and use it as you would use TemplateEmailInfoImpl.

loading table of contents...