Class DefaultAsyncEmailSender<I,O>

java.lang.Object
io.micronaut.email.DefaultAsyncEmailSender<I,O>
Type Parameters:
I - Email Request
O - Email Response
All Implemented Interfaces:
io.micronaut.core.naming.Named, AsyncEmailSender<I,O>

@EachBean(AsyncTransactionalEmailSender.class) public class DefaultAsyncEmailSender<I,O> extends Object implements AsyncEmailSender<I,O>
Decorates with every EmailDecorator and send an email via a AsyncTransactionalEmailSender.
Since:
1.0.0
Author:
Sergio del Amo
  • Constructor Details

    • DefaultAsyncEmailSender

      public DefaultAsyncEmailSender(AsyncTransactionalEmailSender<I,O> transactionalEmailSender, List<EmailDecorator> decorators)
      Parameters:
      transactionalEmailSender - Transactional Email Sender
      decorators - Email decorators
  • Method Details

    • sendAsync

      @NonNull @SingleResult public @NonNull org.reactivestreams.Publisher<O> sendAsync(@NonNull @NotNull Email.Builder emailBuilder, @NonNull @NotNull @NonNull @NotNull Consumer<I> emailRequest) throws EmailException
      Description copied from interface: AsyncEmailSender
      Sends an email.
      Specified by:
      sendAsync in interface AsyncEmailSender<I,O>
      Parameters:
      emailBuilder - Email Builder
      emailRequest - Email Request
      Returns:
      Response Object or empty optional if an error occurred
      Throws:
      EmailException - Wrapper of any exception thrown while sending email
    • getName

      @NonNull public @NonNull String getName()
      Specified by:
      getName in interface io.micronaut.core.naming.Named