Class SesEmailSender

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

@Named("ses") @Requires(beans=software.amazon.awssdk.services.ses.SesClient.class) @Singleton public class SesEmailSender extends Object implements TransactionalEmailSender<software.amazon.awssdk.services.ses.model.SesRequest,software.amazon.awssdk.services.ses.model.SesResponse>
Since:
1.0.0
Author:
Sergio del Amo
  • Field Details

  • Constructor Details

    • SesEmailSender

      public SesEmailSender(software.amazon.awssdk.services.ses.SesClient 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
    • send

      @NonNull public @NonNull software.amazon.awssdk.services.ses.model.SesResponse send(@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:
      send in interface TransactionalEmailSender<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