Class MultipartBody

java.lang.Object
io.micronaut.email.MultipartBody
All Implemented Interfaces:
Body

public class MultipartBody extends Object implements Body
Multipart bodies represent an HTML and text version of the same body content. For providers that support falling back to text for simple email clients both bodies will be sent. For clients that only support a single body, the HTML content will be sent.
Since:
1.0.0
Author:
James Kleeh, Sergio del Amo
  • Constructor Details

    • MultipartBody

      public MultipartBody(@NonNull @NonNull String html, @NonNull @NonNull String text)
      Parameters:
      html - The HTML content
      text - The text content
    • MultipartBody

      public MultipartBody(@NonNull @NonNull Body html, @NonNull @NonNull Body text)
      Parameters:
      html - The HTML content
      text - The text content
    • MultipartBody

      public MultipartBody(@NonNull @NonNull Body html, @NonNull @NonNull String text)
      Parameters:
      html - The HTML content
      text - The text content
    • MultipartBody

      public MultipartBody(@NonNull @NonNull String html, @NonNull @NonNull Body text)
      Parameters:
      html - The HTML content
      text - The text content
  • Method Details

    • get

      @NonNull public @NonNull Optional<String> get(@NonNull @NonNull BodyType bodyType)
      Specified by:
      get in interface Body
    • getHtml

      @NonNull public @NonNull Body getHtml()
      Returns:
      HTML Part
    • getText

      @NonNull public @NonNull Body getText()
      Returns:
      Text Part