Class DefaultEmailSender<I,O>

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

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

    • DefaultEmailSender

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

    • send

      @NonNull public O send(@NonNull @NotNull Email.Builder emailBuilder, @NonNull @NotNull @NonNull @NotNull Consumer<I> emailRequest) throws EmailException
      Description copied from interface: EmailSender
      Sends an email.
      Specified by:
      send in interface EmailSender<I,O>
      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
    • getName

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