Class AsyncSesEmailSender

java.lang.Object
io.micronaut.email.ses.AsyncSesEmailSender
All Implemented Interfaces:
io.micronaut.core.naming.Named, AsyncTransactionalEmailSender<software.amazon.awssdk.services.ses.model.SesRequest,software.amazon.awssdk.services.ses.model.SesResponse>

@Named("ses") @Requires(beans=software.amazon.awssdk.services.ses.SesAsyncClient.class) @Singleton public class AsyncSesEmailSender extends Object implements AsyncTransactionalEmailSender<software.amazon.awssdk.services.ses.model.SesRequest,software.amazon.awssdk.services.ses.model.SesResponse>
Amazon Simple Email Service implementation of @link io.micronaut.email.AsyncTransactionalEmailSender}.
Since:
1.0.0
Author:
Sergio del Amo
  • Field Details

  • Constructor Details

    • AsyncSesEmailSender

      public AsyncSesEmailSender(software.amazon.awssdk.services.ses.SesAsyncClient ses, SesEmailComposer messageComposer)
      Parameters:
      ses - Amazon Simple Email Service Client
      messageComposer - Message Composer
  • Method Details

    • getName

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

      @NonNull @SingleResult public @NonNull org.reactivestreams.Publisher<software.amazon.awssdk.services.ses.model.SesResponse> sendAsync(@NonNull @NotNull @Valid @NonNull @NotNull @Valid Email email, @NonNull @NotNull @NonNull @NotNull Consumer<software.amazon.awssdk.services.ses.model.SesRequest> emailRequest) throws EmailException
      Sends an email.
      Specified by:
      sendAsync in interface AsyncTransactionalEmailSender<software.amazon.awssdk.services.ses.model.SesRequest,software.amazon.awssdk.services.ses.model.SesResponse>
      Parameters:
      email - Email
      emailRequest - Email Request Consumer
      Returns:
      SendRawEmailResponse or SendEmailResponse or empty optional if an error occurred
      Throws:
      EmailException - Wrapper of any exception thrown while sending email