Clearspace API (2.5.29) Core Javadocs

com.jivesoftware.community
Class EmailMessage

java.lang.Object
  extended by com.jivesoftware.community.EmailMessage
All Implemented Interfaces:
Serializable

public class EmailMessage
extends Object
implements Serializable

Represents an Email message that can be sent using EmailManager

See Also:
EmailManager, Serialized Form

Nested Class Summary
static class EmailMessage.EmailAddress
          Represents an email address with a name like Andrew Wright <andrew@jivesoftware.com>
 
Constructor Summary
EmailMessage()
           
 
Method Summary
 void addAttachment(com.jivesoftware.util.InputStreamDataSource attachment)
          Adds an attachment for this email message
 void addRecipient(EmailMessage.EmailAddress emailAddress)
          Adds a recipient (to address) for this email message
 void addRecipient(String name, String email)
          Adds a recipient (to address) for this email message
 boolean equals(Object o)
           
 Collection<DataSource> getAttachments()
          Returns the attachments of the email
 Map<String,Object> getContext()
          Returns a map of replacement tokens to use in the email
 String getHtmlBody()
          Returns the html version of the body
 String getHtmlBodyProperty()
           
 Locale getLocale()
          Return the locale for the email message.
 Collection<EmailMessage.EmailAddress> getRecipients()
          Returns the recipients of the email
 EmailMessage.EmailAddress getReplyTo()
           
 EmailMessage.EmailAddress getSender()
          Returns the sender of them email
 String getSubject()
          Returns the subject of the email.
 String getSubjectProperty()
          Returns the property name for subject of the email
 String getTextBody()
          Returns the text version of the body.
 String getTextBodyProperty()
          Return the property name for the html version of the email body
 int hashCode()
           
 boolean isBccSender()
          If copySender is set to true, the sender will be BCCed on the message.
 void setBccSender(boolean bccSender)
          If copySender is set to true, the sender will be BCCed on the message.
 void setContext(Map<String,Object> context)
          Sets the context map.
 void setHtmlBody(String htmlBody)
          Sets the text version of the body.
 void setHtmlBodyProperty(String htmlBodyProperty)
           
 void setLocale(Locale locale)
          Set the locale for the email message.
 EmailMessage setReplyTo(EmailMessage.EmailAddress replyTo)
          Sets the reply-to header for the email.
 EmailMessage setReplyTo(String name, String email)
          Sets the reply-to header for the email.
 void setSender(EmailMessage.EmailAddress sender)
          Sets the address the email is sent from.
 void setSender(String name, String email)
          Sets the address the email is sent from.
 void setShouldFreemarkerParse(boolean shouldFreemarkerParse)
           
 void setSubject(String subject)
          Sets the subject of the email.
 void setSubjectProperty(String subjectProperty)
          Sets the email's subject property name
 void setTextBody(String textBody)
          Sets the text version of the body.
 void setTextBodyProperty(String textBodyProperty)
          Set the property name for the html version of the email body
 boolean shouldFreemarkerParse()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EmailMessage

public EmailMessage()
Method Detail

addAttachment

public void addAttachment(com.jivesoftware.util.InputStreamDataSource attachment)
Adds an attachment for this email message

Parameters:
attachment - the data source representing the email message attachment

addRecipient

public void addRecipient(EmailMessage.EmailAddress emailAddress)
Adds a recipient (to address) for this email message

Parameters:
emailAddress - the recipient's address

addRecipient

public void addRecipient(String name,
                         String email)
Adds a recipient (to address) for this email message

Parameters:
name - the name of the recipient
email - the email address of the recipient

setSender

public void setSender(String name,
                      String email)
Sets the address the email is sent from.

Parameters:
name - Name of the sender
email - Email address of the sender

setSender

public void setSender(EmailMessage.EmailAddress sender)
Sets the address the email is sent from.

Sender only needs to be set if it is different than the system default.

Parameters:
sender - The sender's email address

setBccSender

public void setBccSender(boolean bccSender)
If copySender is set to true, the sender will be BCCed on the message. Default is false.

Parameters:
bccSender - Whether or not to copy the sender on the email.

isBccSender

public boolean isBccSender()
If copySender is set to true, the sender will be BCCed on the message. Default is false.

Returns:
Whether or not to copy the sender on the email.

setReplyTo

public EmailMessage setReplyTo(String name,
                               String email)
Sets the reply-to header for the email.

Parameters:
name - the name of the entity who replies should be sent to for this email.
email - the email address of the entity to whom replies are to be sent.
Returns:
this

setReplyTo

public EmailMessage setReplyTo(EmailMessage.EmailAddress replyTo)
Sets the reply-to header for the email.

Parameters:
replyTo - the email address of the entity to whom replies are to be sent.
Returns:
this

getReplyTo

public EmailMessage.EmailAddress getReplyTo()

setSubjectProperty

public void setSubjectProperty(String subjectProperty)
Sets the email's subject property name

Parameters:
subjectProperty - the email's subject

setTextBodyProperty

public void setTextBodyProperty(String textBodyProperty)
Set the property name for the html version of the email body

Parameters:
textBodyProperty - the property name for the html version of the email body

getAttachments

public Collection<DataSource> getAttachments()
Returns the attachments of the email

Returns:
the attachments of the email

getRecipients

public Collection<EmailMessage.EmailAddress> getRecipients()
Returns the recipients of the email

Returns:
the recipients of the email

getSender

public EmailMessage.EmailAddress getSender()
Returns the sender of them email

Returns:
the sender of the email

getSubjectProperty

public String getSubjectProperty()
Returns the property name for subject of the email

Returns:
the property name for subject of the email

getSubject

public String getSubject()
Returns the subject of the email. Should be specified if subjectProperty is not specified.

Returns:
the subject of the email.

setSubject

public void setSubject(String subject)
Sets the subject of the email. Should be specified if subjectProperty is not specified.

Parameters:
subject - the subject of the email.

getTextBodyProperty

public String getTextBodyProperty()
Return the property name for the html version of the email body

Returns:
the property name for the html version of the email body

getTextBody

public String getTextBody()
Returns the text version of the body.

Returns:
the text version of the body.

setTextBody

public void setTextBody(String textBody)
Sets the text version of the body.

Parameters:
textBody - the text version of the body.

getHtmlBody

public String getHtmlBody()
Returns the html version of the body

Returns:
the htmlVersion of the body.

setHtmlBody

public void setHtmlBody(String htmlBody)
Sets the text version of the body.

Parameters:
htmlBody - the text version of the body.

getLocale

public Locale getLocale()
Return the locale for the email message. This in conjunction with the body|subject property name will be used to acquire the correct email content

Returns:
the locale for the email message

setLocale

public void setLocale(Locale locale)
Set the locale for the email message. This in conjunction with the body|subject property name will be used to acquire the correct email content

Parameters:
locale - the locale for the email message

getContext

public Map<String,Object> getContext()
Returns a map of replacement tokens to use in the email

Returns:
a map of replacement tokens

setContext

public void setContext(Map<String,Object> context)
Sets the context map.

Parameters:
context - the context.

getHtmlBodyProperty

public String getHtmlBodyProperty()

setHtmlBodyProperty

public void setHtmlBodyProperty(String htmlBodyProperty)

shouldFreemarkerParse

public boolean shouldFreemarkerParse()

setShouldFreemarkerParse

public void setShouldFreemarkerParse(boolean shouldFreemarkerParse)

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object

Clearspace Project Page

Copyright © 1999-2007 Jive Software.