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.

    @FunctionalInterface
    public interface ResponseBodyGenerator
    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:
    RFC 8823
    • Method Detail

      • 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