Class MessageTemplate
java.lang.Object
org.deltava.beans.system.MessageTemplate
- All Implemented Interfaces:
Serializable
,Cloneable
,Comparable<MessageTemplate>
,Auditable
,ViewEntry
,Cacheable
public class MessageTemplate
extends Object
implements Comparable<MessageTemplate>, Auditable, Cacheable, ViewEntry
A class for storing E-Mail message templates.
- Since:
- 1.0
- Version:
- 11.0
- Author:
- Luke
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionMessageTemplate
(String name) Creates a new Message Template with a given name and subject. -
Method Summary
Modifier and TypeMethodDescriptioncacheKey()
Returns the cache key for this object.int
compareTo
(MessageTemplate mt2) boolean
Returns the action types to embed in the push notification.Returns the object ID for this auditable object.getBody()
Returns the body of the message template.Returns a user-readable description of this Message template.boolean
Returns if the message should be sent as HTML or plain text.getName()
Returns the name of the template.boolean
Returns if replies to the message should be disabled.int
Returns the TTL of the push notification sent.Returns the ID of the push notification context object.Returns the CSS class for this object if rendered in a view table.Returns the subject of the generated e-mail message.int
hashCode()
boolean
Returns whether this object is within multiple web applications.void
setActionTypes
(Collection<NotifyActionType> types) Updates the action types appended to the push notification.void
Updates the body of this message template.void
setDescription
(String desc) Updates the description of this message template.void
setIsHTML
(boolean html) Sets whether this message should be sent as HTML or plain text.void
setNoReply
(boolean noReply) Sets whether replies to this message should be disabled.void
setNotificationTTL
(int ttl) Updates the TTL of the push notification.void
Updates the ID of the push notification context object.void
setSubject
(String subj) Updates the e-mail message subject.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.deltava.beans.Auditable
getAuditType
-
Constructor Details
-
MessageTemplate
Creates a new Message Template with a given name and subject.- Parameters:
name
- the name of the template- Throws:
NullPointerException
- if either name or subject are null- See Also:
-
-
Method Details
-
getName
-
getSubject
Returns the subject of the generated e-mail message.- Returns:
- the e-mail message subject
- See Also:
-
getDescription
Returns a user-readable description of this Message template.- Returns:
- the template description
- See Also:
-
getBody
Returns the body of the message template.- Returns:
- the message template body. This can contain macros to be parsed by MessageContext.
- See Also:
-
getIsHTML
public boolean getIsHTML()Returns if the message should be sent as HTML or plain text.- Returns:
- TRUE if the message is formatted as HTML, otherwise FALSE
- See Also:
-
getNoReply
public boolean getNoReply()Returns if replies to the message should be disabled.- Returns:
- TRUE if replies disabled, otherwise FALSE
- See Also:
-
getActionTypes
Returns the action types to embed in the push notification.- Returns:
- a Collection of NotifyActionType enums
-
getNotifyContext
Returns the ID of the push notification context object.- Returns:
- the context object ID or null if none
-
getNotificationTTL
public int getNotificationTTL()Returns the TTL of the push notification sent.- Returns:
- the TTL in seconds
-
isCrossApp
public boolean isCrossApp()Description copied from interface:Auditable
Returns whether this object is within multiple web applications. Objects where this is false will need additional data appended to the audit ID to prevent information leakage across applications where the audit IDs are identical between apps.- Specified by:
isCrossApp
in interfaceAuditable
- Returns:
- TRUE if cross-application, otherwise FALSE
-
setDescription
Updates the description of this message template.- Parameters:
desc
- the new template description- Throws:
NullPointerException
- if desc is null- See Also:
-
setBody
Updates the body of this message template.- Parameters:
body
- the new template body- See Also:
-
setSubject
Updates the e-mail message subject.- Parameters:
subj
- the subject- Throws:
NullPointerException
- if subj is null- See Also:
-
setIsHTML
public void setIsHTML(boolean html) Sets whether this message should be sent as HTML or plain text.- Parameters:
html
- TRUE if the message is HTML, otherwise FALSE- See Also:
-
setNoReply
public void setNoReply(boolean noReply) Sets whether replies to this message should be disabled.- Parameters:
noReply
- TRUE if replies are disabled, otherwise FALSE- See Also:
-
setActionTypes
Updates the action types appended to the push notification.- Parameters:
types
- a Collection of NotifyActionType enumerations
-
setNotificationTTL
public void setNotificationTTL(int ttl) Updates the TTL of the push notification.- Parameters:
ttl
- the ttl in seconds
-
setNotifyContext
Updates the ID of the push notification context object.- Parameters:
id
- the ID
-
equals
-
hashCode
-
compareTo
- Specified by:
compareTo
in interfaceComparable<MessageTemplate>
-
cacheKey
-
getAuditID
Description copied from interface:Auditable
Returns the object ID for this auditable object.- Specified by:
getAuditID
in interfaceAuditable
- Returns:
- the ID
-
getRowClassName
Description copied from interface:ViewEntry
Returns the CSS class for this object if rendered in a view table.- Specified by:
getRowClassName
in interfaceViewEntry
- Returns:
- the CSS class name, or NULL if none
-