Class EmailProperties

java.lang.Object
org.apereo.cas.configuration.model.support.email.EmailProperties
All Implemented Interfaces:
Serializable

@RequiresModule(name="cas-server-core-util", automated=true) public class EmailProperties extends Object implements Serializable
Since:
5.2.0
See Also:
  • 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

      public List<String> 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

      public String 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 variable out 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

      public String getFrom()
      Email from address.
    • getSubject

      public String 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

      public List<String> getCc()
      Email CC address, if any.
    • getBcc

      public List<String> getBcc()
      Email BCC address, if any.
    • getReplyTo

      public String 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

      public EmailProperties setAttributeName(List<String> attributeName)
      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

      public EmailProperties setText(String text)
      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 variable out 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

      public EmailProperties setFrom(String from)
      Email from address.
      Returns:
      this.
    • setSubject

      public EmailProperties setSubject(String subject)
      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

      public EmailProperties setCc(List<String> cc)
      Email CC address, if any.
      Returns:
      this.
    • setBcc

      public EmailProperties setBcc(List<String> bcc)
      Email BCC address, if any.
      Returns:
      this.
    • setReplyTo

      public EmailProperties setReplyTo(String replyTo)
      Email Reply-To address, if any.
      Returns:
      this.
    • setHtml

      public EmailProperties setHtml(boolean html)
      Indicate whether the message body should be evaluated as HTML text.
      Returns:
      this.
    • setValidateAddresses

      public EmailProperties setValidateAddresses(boolean validateAddresses)
      Set whether to validate all addresses which get passed to this helper.
      Returns:
      this.
    • setPriority

      public EmailProperties setPriority(int priority)
      Set the priority (X-Priority header) of the message. Values: 1 (Highest), 2 (High), 3 (Normal), 4 (Low), 5 (Lowest).
      Returns:
      this.