Interface RenderableEmail


public interface RenderableEmail
A RenderableEmail is a container of the data needed for constructing and sending an email.

The body of the email can be rendered by calling one of the two rendering methods: render() and renderPlainText().

Since:
3.1.0
  • Method Details

    • getLocale

      Locale getLocale()
      Returns the locale used when rendering this email.
      Returns:
      the locale of this email
    • getSubject

      @Nullable @Nullable String getSubject()
      Returns the subject of this email.
      Returns:
      the subject of this email
    • getModel

      Map<String,Object> getModel()
      Returns the read-only data model of this email.
      Returns:
      the data model of this email.
    • getTemplateResource

      String getTemplateResource()
      Returns the template resource used for rendering this email.
      Returns:
      the template resource of this email
    • getTemplateArea

      @Nullable @Nullable String getTemplateArea()
      Returns the template area where the template resource of this email is located. If no template area has been configured for the context that this email is sent null is returned.
      Returns:
      the template area of this email, or null
    • renderPlainText

      String renderPlainText() throws IOException
      Renders this email as a plaintext message.
      Returns:
      a plaintext rendering of this email as String
      Throws:
      IOException - if rendering fails
    • render

      String render() throws IOException
      Renders this email in a format determined by the template resource of this email.
      Returns:
      a rendering of this email as String
      Throws:
      IOException - if rendering fails