Class MailjetEmailSender

java.lang.Object
io.micronaut.email.mailjet.MailjetEmailSender
All Implemented Interfaces:
io.micronaut.core.naming.Named, AsyncTransactionalEmailSender<com.mailjet.client.MailjetRequest,com.mailjet.client.MailjetResponse>, TransactionalEmailSender<com.mailjet.client.MailjetRequest,com.mailjet.client.MailjetResponse>

@Named("mailjet") @Requires(beans={MailjetConfiguration.class,MailjetEmailComposer.class}) @Singleton public class MailjetEmailSender extends Object implements TransactionalEmailSender<com.mailjet.client.MailjetRequest,com.mailjet.client.MailjetResponse>, AsyncTransactionalEmailSender<com.mailjet.client.MailjetRequest,com.mailjet.client.MailjetResponse>
Since:
1.0.0
Author:
Sergio del Amo
  • Field Details

  • Constructor Details

    • MailjetEmailSender

      public MailjetEmailSender(MailjetConfiguration mailjetConfiguration, MailjetEmailComposer mailjetEmailComposer)
      Parameters:
      mailjetConfiguration - Mailjet Configuration.
      mailjetEmailComposer - Mailjet Request Composer
  • Method Details

    • getName

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

      @NonNull public @NonNull com.mailjet.client.MailjetResponse send(@NonNull @NotNull @Valid @NonNull @NotNull @Valid Email email, @NonNull @NotNull @NonNull @NotNull Consumer<com.mailjet.client.MailjetRequest> emailRequest) throws EmailException
      Description copied from interface: TransactionalEmailSender
      Sends an email.
      Specified by:
      send in interface TransactionalEmailSender<com.mailjet.client.MailjetRequest,com.mailjet.client.MailjetResponse>
      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
    • sendAsync

      @NonNull public @NonNull org.reactivestreams.Publisher<com.mailjet.client.MailjetResponse> sendAsync(@NonNull @NotNull @Valid @NonNull @NotNull @Valid Email email, @NonNull @NotNull @NonNull @NotNull Consumer<com.mailjet.client.MailjetRequest> emailRequest) throws EmailException
      Description copied from interface: AsyncTransactionalEmailSender
      Sends an email.
      Specified by:
      sendAsync in interface AsyncTransactionalEmailSender<com.mailjet.client.MailjetRequest,com.mailjet.client.MailjetResponse>
      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