public class PersonalizedURLEmailContent extends java.lang.Object implements PersonalizedEmailContent
PersonalizedEmailContent
which uses a struts view or a URL request to
fetch the personalized e-mail message content. This class is intended for use when a JSP or other
dynamic URL resource is to be the source of e-mail content. Attention should be paid to the getSubject()
method and the requirements it places on URLs used for this purpose.
This class uses the JSPPATH data of the e-mail template from the EMLMSG database table. The following
logic is performed:
URLConnection
to get the content of the e-mail.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
COPYRIGHT
Copyright.
|
Constructor and Description |
---|
PersonalizedURLEmailContent(Recipient recipient)
Constructor that initializes this instance with a Recipient.
|
PersonalizedURLEmailContent(Recipient recipient,
java.lang.String url)
Constructor that initializes this instance with a Recipient and a view or url.
|
PersonalizedURLEmailContent(java.lang.String url)
Constructor that initializes this instance with a content view or url.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getContent()
Gets the content of the e-mail message by making a URLConnection to the given
url and using the result as the message body content.
|
Recipient |
getRecipient()
Gets the recipient for whom the e-mail will be personalized.
|
boolean |
getSendEmail()
This method gets the setting whether the e-mail should be sent to the customer.
|
java.lang.Integer |
getStoreId()
Returns the store ID, used by the tag engine implementation for
parsing the content of e-mail message.
|
java.lang.String |
getSubject()
Gets the subject line from the content url.
|
java.lang.String |
getUrl()
Gets the view or url used to read e-mail content.
|
void |
setContentReusable(boolean reusable)
Sets the content of the e-mail message to be reused by subsequent calls to getContent() and getSubject().
|
void |
setQueryStringPair(java.lang.String queryStringName,
java.lang.String queryStringValue)
Sets a name/value pair which will be added to the query string of this
URLEmailContent.
|
void |
setRecipient(Recipient recipient)
Sets the recipient for whom the e-mail will be personalized.
|
void |
setSendEmail(boolean newSendEmail)
This method sets whether the e-mail should be sent to the customer.
|
void |
setStoreId(java.lang.Integer newStoreId)
Sets the store ID, which will be used by the TagEngine while parsing
the e-mail content.
|
void |
setUrl(java.lang.String url)
Sets the view or url that will be used to locate the content of the email.
|
public static final java.lang.String COPYRIGHT
public PersonalizedURLEmailContent(Recipient recipient)
recipient
- public PersonalizedURLEmailContent(Recipient recipient, java.lang.String url)
recipient
- the Recipient
for whom the content will be personalized.url
- the view or url to use for retrieving content of the email.public PersonalizedURLEmailContent(java.lang.String url)
url
- the view or url to use when fetching e-mail content for the given recipient.public java.lang.String getContent()
getContent
in interface EmailContent
public Recipient getRecipient()
getRecipient
in interface PersonalizedEmailContent
Recipient
.public boolean getSendEmail()
getSendEmail
in interface PersonalizedEmailContent
public java.lang.Integer getStoreId()
public java.lang.String getSubject()
getSubject
in interface EmailContent
public java.lang.String getUrl()
public void setContentReusable(boolean reusable)
reusable
- set to true, if the is reusable, false otherwise.public void setQueryStringPair(java.lang.String queryStringName, java.lang.String queryStringValue)
queryStringName
- the name of the name/value pair to add to the query string.queryStringValue
- the value of the name/value pair to add to the query string.public void setRecipient(Recipient recipient)
setRecipient
in interface PersonalizedEmailContent
recipient
- the Recipient
.public void setSendEmail(boolean newSendEmail)
getSubject
or getContent
methods.newSendEmail
- Set to false if the e-mail should not be sent.public void setStoreId(java.lang.Integer newStoreId)
newStoreId
- The ID of the storepublic void setUrl(java.lang.String url)
url
- the e-mail content view or url to use.