Class AbstractTransactionalEmailSender<I,O>

java.lang.Object
io.micronaut.email.AbstractTransactionalEmailSender<I,O>
Type Parameters:
I - Email Request
O - Email Response
All Implemented Interfaces:
io.micronaut.core.naming.Named, AsyncTransactionalEmailSender<I,O>, TransactionalEmailSender<I,O>
Direct Known Subclasses:
JavaxEmailSender, PostmarkEmailSender

public abstract class AbstractTransactionalEmailSender<I,O> extends Object implements AsyncTransactionalEmailSender<I,O>, TransactionalEmailSender<I,O>
Abstract class which implements both TransactionalEmailSender and AsyncTransactionalEmailSender. It provides an implemeentation of AsyncTransactionalEmailSender.sendAsync(Email, Consumer) by subscribing on an IO scheduler.
Since:
1.0.0
Author:
Sergio del Amo
  • Constructor Details

    • AbstractTransactionalEmailSender

      protected AbstractTransactionalEmailSender(@Named("io") ExecutorService executorService)
      Parameters:
      executorService - Executor service
  • Method Details

    • sendAsync

      @NonNull @SingleResult public @NonNull org.reactivestreams.Publisher<O> sendAsync(@NonNull @NotNull @NonNull @NotNull Email email, @NonNull @NotNull @NonNull @NotNull Consumer<I> emailRequest) throws EmailException
      Description copied from interface: AsyncTransactionalEmailSender
      Sends an email.
      Specified by:
      sendAsync in interface AsyncTransactionalEmailSender<I,O>
      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