Interface ResponseBodyGenerator

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

A generator for the response body to be set to the Message.

This generator can be used to design the body of the outgoing response email. However, note that the response email is evaluated by a machine and usually not read by humans, so the design should be kept simple, and must be conformous to RFC-8823.

The responseBody must be a part of the response email body, otherwise the validation will fail.

A minimal implementation is:

 response.setContent(responseBody, RESPONSE_BODY_TYPE);
 
Since:
2.12
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    The content-type of the response body: "text/plain"
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    setContent(jakarta.mail.Message response, String responseBody)
    Sets the content of the Message.
  • Field Details

  • Method Details

    • setContent

      void setContent(jakarta.mail.Message response, String responseBody) throws jakarta.mail.MessagingException
      Sets the content of the Message.
      Parameters:
      response - Message to set the body content.
      responseBody - The response body that must be part of the email response, and must use "text/plain" content type.
      Throws:
      jakarta.mail.MessagingException