Class EmailProperties
- All Implemented Interfaces:
Serializable
EmailProperties
.- Since:
- 5.2.0
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionPrincipal attribute names that indicates the destination email address for this message.getBcc()
Email BCC address, if any.getCc()
Email CC address, if any.getFrom()
Email from address.int
Set the priority (X-Priority
header) of the message.Email Reply-To address, if any.Email subject line.getText()
Email message body.boolean
Is text/from/subject defined.boolean
isHtml()
Indicate whether the message body should be evaluated as HTML text.boolean
Indicate whether email settings are defined.boolean
Set whether to validate all addresses which get passed to this helper.setAttributeName
(List<String> attributeName) Principal attribute names that indicates the destination email address for this message.Email BCC address, if any.Email CC address, if any.Email from address.setHtml
(boolean html) Indicate whether the message body should be evaluated as HTML text.setPriority
(int priority) Set the priority (X-Priority
header) of the message.setReplyTo
(String replyTo) Email Reply-To address, if any.setSubject
(String subject) Email subject line.Email message body.setValidateAddresses
(boolean validateAddresses) Set whether to validate all addresses which get passed to this helper.
-
Constructor Details
-
EmailProperties
public EmailProperties()
-
-
Method Details
-
isUndefined
public boolean isUndefined()Indicate whether email settings are defined.- Returns:
- true if undefined, false otherwise.
-
isDefined
public boolean isDefined()Is text/from/subject defined.- Returns:
- true/false
-
getAttributeName
Principal attribute names that indicates the destination email address for this message. The attributes must already be resolved and available to the CAS principal. When multiple attributes are specified, each attribute is then examined against the available CAS principal to locate the email address value, which may result in multiple emails being sent. -
getText
Email message body. Could be plain text or a reference to an external file that would serve as a template.If specified as a path to an external file with an extension
.gtemplate
, then the email message body would be processed using the Groovy template engine. The template engine uses JSP style <% %> script and <%= %> expression syntax or GString style expressions. The variableout
is bound to the writer that the template is being written to.If using plain text, the contents are processed for string subtitution candidates using named variables. For example, you may refer to an expected url variable in the email text via
${url}
, or use${token}
to locate the token variable. In certain cases, additional parameters are passed to the email body processor that might include authentication and/or principal attributes, the available locale, client http information, etc. -
getFrom
Email from address. -
getSubject
Email subject line.The subject can either be defined verbaitm, or it may point to a message key in the language bundle using the syntax
#{subject-language-key}
. This key should point to a valid message defined in the appropriate language bundle that is then picked up via the active locale. In case where the language code cannot resolve the real subject, a default subject value would be used. -
getCc
Email CC address, if any. -
getBcc
Email BCC address, if any. -
getReplyTo
Email Reply-To address, if any. -
isHtml
public boolean isHtml()Indicate whether the message body should be evaluated as HTML text. -
isValidateAddresses
public boolean isValidateAddresses()Set whether to validate all addresses which get passed to this helper. -
getPriority
public int getPriority()Set the priority (X-Priority
header) of the message. Values:1 (Highest)
,2 (High)
,3 (Normal)
,4 (Low)
,5 (Lowest)
. -
setAttributeName
Principal attribute names that indicates the destination email address for this message. The attributes must already be resolved and available to the CAS principal. When multiple attributes are specified, each attribute is then examined against the available CAS principal to locate the email address value, which may result in multiple emails being sent.- Returns:
this
.
-
setText
Email message body. Could be plain text or a reference to an external file that would serve as a template.If specified as a path to an external file with an extension
.gtemplate
, then the email message body would be processed using the Groovy template engine. The template engine uses JSP style <% %> script and <%= %> expression syntax or GString style expressions. The variableout
is bound to the writer that the template is being written to.If using plain text, the contents are processed for string subtitution candidates using named variables. For example, you may refer to an expected url variable in the email text via
${url}
, or use${token}
to locate the token variable. In certain cases, additional parameters are passed to the email body processor that might include authentication and/or principal attributes, the available locale, client http information, etc.- Returns:
this
.
-
setFrom
Email from address.- Returns:
this
.
-
setSubject
Email subject line.The subject can either be defined verbaitm, or it may point to a message key in the language bundle using the syntax
#{subject-language-key}
. This key should point to a valid message defined in the appropriate language bundle that is then picked up via the active locale. In case where the language code cannot resolve the real subject, a default subject value would be used.- Returns:
this
.
-
setCc
Email CC address, if any.- Returns:
this
.
-
setBcc
Email BCC address, if any.- Returns:
this
.
-
setReplyTo
Email Reply-To address, if any.- Returns:
this
.
-
setHtml
Indicate whether the message body should be evaluated as HTML text.- Returns:
this
.
-
setValidateAddresses
Set whether to validate all addresses which get passed to this helper.- Returns:
this
.
-
setPriority
Set the priority (X-Priority
header) of the message. Values:1 (Highest)
,2 (High)
,3 (Normal)
,4 (Low)
,5 (Lowest)
.- Returns:
this
.
-