Class PostmarkEmailSender

java.lang.Object
io.micronaut.email.AbstractTransactionalEmailSender<com.postmarkapp.postmark.client.data.model.message.Message,com.postmarkapp.postmark.client.data.model.message.MessageResponse>
io.micronaut.email.postmark.PostmarkEmailSender
All Implemented Interfaces:
io.micronaut.core.naming.Named, AsyncTransactionalEmailSender<com.postmarkapp.postmark.client.data.model.message.Message,com.postmarkapp.postmark.client.data.model.message.MessageResponse>, TransactionalEmailSender<com.postmarkapp.postmark.client.data.model.message.Message,com.postmarkapp.postmark.client.data.model.message.MessageResponse>

@Named("postmark") @Requires(beans={PostmarkConfiguration.class,PostmarkEmailComposer.class}) @Singleton public class PostmarkEmailSender extends AbstractTransactionalEmailSender<com.postmarkapp.postmark.client.data.model.message.Message,com.postmarkapp.postmark.client.data.model.message.MessageResponse>
Since:
1.0.0
Author:
Sergio del Amo
  • Field Details

  • Constructor Details

    • PostmarkEmailSender

      public PostmarkEmailSender(@Named("io") ExecutorService executorService, PostmarkConfiguration postmarkConfiguration, PostmarkEmailComposer postmarkEmailComposer)
      Parameters:
      executorService - Executor service
      postmarkConfiguration - Postmark configuration
      postmarkEmailComposer - Postmark Email Composer
  • Method Details

    • getName

      @NonNull public @NonNull String getName()
    • send

      @NonNull public @NonNull com.postmarkapp.postmark.client.data.model.message.MessageResponse send(@NonNull @NotNull @Valid @NonNull @NotNull @Valid Email email, @NonNull @NotNull @NonNull @NotNull Consumer<com.postmarkapp.postmark.client.data.model.message.Message> emailRequest) throws EmailException
      Description copied from interface: TransactionalEmailSender
      Sends an email.
      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