Class Email.Builder

java.lang.Object
io.micronaut.email.Email.Builder
Enclosing class:
Email

public static class Email.Builder extends Object
Email builder.
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • from

      @NonNull public Email.Builder from(@NonNull @NonNull String from)
      Parameters:
      from - contact sending the email
      Returns:
      Email Builder
    • from

      @NonNull public Email.Builder from(@NonNull @NonNull Contact from)
      Parameters:
      from - contact sending the email
      Returns:
      Email Builder
    • replyTo

      @NonNull public Email.Builder replyTo(@NonNull @NonNull String replyTo)
      Parameters:
      replyTo - Reply to contact
      Returns:
      Email Builder
    • replyTo

      @NonNull public Email.Builder replyTo(@NonNull @NonNull Contact replyTo)
      Parameters:
      replyTo - Reply to contact
      Returns:
      Email Builder
    • to

      @NonNull public Email.Builder to(@NonNull @NonNull String to)
      Parameters:
      to - Recipients to
      Returns:
      Email Builder
    • to

      @NonNull public Email.Builder to(@NonNull @NonNull Contact to)
      Parameters:
      to - Recipients to
      Returns:
      Email Builder
    • cc

      @NonNull public Email.Builder cc(@NonNull @NonNull Contact cc)
      Parameters:
      cc - carbon copy recipient.
      Returns:
      Email Builder
    • cc

      @NonNull public Email.Builder cc(@NonNull @NonNull String cc)
      Parameters:
      cc - carbon copy recipient.
      Returns:
      Email Builder
    • bcc

      @NonNull public Email.Builder bcc(@NonNull @NonNull Contact bcc)
      Parameters:
      bcc - blind carbon copy recipient.
      Returns:
      Email Builder
    • bcc

      @NonNull public Email.Builder bcc(@NonNull @NonNull String bcc)
      Parameters:
      bcc - blind carbon copy recipient.
      Returns:
      Email Builder
    • subject

      @NonNull public Email.Builder subject(@NonNull @NonNull String subject)
      Parameters:
      subject - Email subject
      Returns:
      Email Builder
    • attachment

      @NonNull public Email.Builder attachment(@NonNull @NonNull Attachment attachment)
      Parameters:
      attachment - Email attachment
      Returns:
      Email Builder
    • attachment

      @NonNull public Email.Builder attachment(@NonNull @NonNull Consumer<Attachment.Builder> attachment)
      Parameters:
      attachment - attachment builder consumer
      Returns:
      Email Builder
    • body

      @NonNull public @NonNull Email.Builder body(@NonNull @NonNull Body body)
      Parameters:
      body - Email's body
      Returns:
      The Email Builder
    • body

      @NonNull public @NonNull Email.Builder body(@NonNull @NonNull String body, BodyType bodyType)
      Parameters:
      body - Email body
      bodyType - Email body type
      Returns:
      The Email Builder
    • body

      @NonNull public @NonNull Email.Builder body(@NonNull @NonNull String text)
      Parameters:
      text - Email body text
      Returns:
      The Email Builder
    • body

      @NonNull public @NonNull Email.Builder body(@NonNull @NonNull String html, @NonNull @NonNull String text)
      Parameters:
      html - Email body HTML
      text - Email body Text
      Returns:
      The Email Builder
    • build

      @NonNull public @NonNull Email build()
      Returns:
      An email
    • getFrom

      @NonNull public @NonNull Optional<Contact> getFrom()
      Returns:
      Email sender
    • getBody

      @NonNull public @NonNull Optional<Body> getBody()
      Returns:
      Email Body
    • getTo

      @NonNull public @NonNull Optional<List<Contact>> getTo()
      Returns:
      Email recipients.
    • getSubject

      @NonNull public @NonNull Optional<String> getSubject()
      Returns:
      Email's subject
    • getReplyTo

      @NonNull public @NonNull Optional<Contact> getReplyTo()
      Returns:
      Email Reply-to
    • getReplyToList

      @NonNull public @NonNull Optional<List<Contact>> getReplyToList()
      Returns:
      Email Reply-to
    • getCc

      @NonNull public @NonNull Optional<List<Contact>> getCc()
      Returns:
      Email carbon copy recipients.
    • getBcc

      @NonNull public @NonNull Optional<List<Contact>> getBcc()
      Returns:
      Email blind carbon copy recipients.
    • getAttachments

      @NonNull public @NonNull Optional<List<Attachment>> getAttachments()
      Returns:
      Email attachments