Interface EmailSender<I,O>

Type Parameters:
I - Email Request
O - Email Response
All Superinterfaces:
io.micronaut.core.naming.Named
All Known Implementing Classes:
DefaultEmailSender

public interface EmailSender<I,O> extends io.micronaut.core.naming.Named
API to send transactional emails synchronously.
Since:
1.0.0
Author:
Sergio del Amo
  • Method Summary

    Modifier and Type
    Method
    Description
    default O
    send(Email.Builder emailBuilder)
    Sends an email.
    send(Email.Builder emailBuilder, @NonNull @NotNull Consumer<I> emailRequest)
    Sends an email.

    Methods inherited from interface io.micronaut.core.naming.Named

    getName
  • Method Details

    • send

      @NonNull default O send(@NonNull @NotNull Email.Builder emailBuilder) throws EmailException
      Sends an email.
      Parameters:
      emailBuilder - Email Builder
      Returns:
      Response Object or empty optional if an error occurred
      Throws:
      EmailException - Wrapper of any exception thrown while sending email
    • send

      @NonNull O send(@NonNull @NotNull Email.Builder emailBuilder, @NonNull @NotNull @NonNull @NotNull Consumer<I> emailRequest) throws EmailException
      Sends an email.
      Parameters:
      emailBuilder - Email Builder
      emailRequest - Email Request Consumer
      Returns:
      Response Object or empty optional if an error occurred
      Throws:
      EmailException - Wrapper of any exception thrown while sending email