Interface TransactionalEmailSender<I,O>

Type Parameters:
I - Email Request
O - Email Response
All Superinterfaces:
io.micronaut.core.naming.Named
All Known Implementing Classes:
AbstractTransactionalEmailSender, JavaxEmailSender, MailjetEmailSender, PostmarkEmailSender, SendgridEmailSender, SesEmailSender

public interface TransactionalEmailSender<I,O> extends io.micronaut.core.naming.Named
API to be implemented by third party transactional email providers. Emails are validated.
Since:
1.0.0
Author:
Sergio del Amo
  • Method Summary

    Modifier and Type
    Method
    Description
    default O
    send(@NonNull @NotNull @Valid Email email)
    Sends an email.
    send(@NonNull @NotNull @Valid Email email, @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 @Valid @NonNull @NotNull @Valid Email email) throws EmailException
      Sends an email.
      Parameters:
      email - Email
      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 @Valid @NonNull @NotNull @Valid Email email, @NonNull @NotNull @NonNull @NotNull Consumer<I> emailRequest) throws EmailException
      Sends an email.
      Parameters:
      email - Email
      emailRequest - Email Request Consumer
      Returns:
      Response Object or empty optional if an error occurred
      Throws:
      EmailException - Wrapper of any exception thrown while sending email