@Named(value="mailjet") @Requires(beans={MailjetConfiguration.class,MailjetEmailComposer.class}) @Singleton public class MailjetEmailSender extends java.lang.Object implements TransactionalEmailSender<com.mailjet.client.MailjetRequest,com.mailjet.client.MailjetResponse>, AsyncTransactionalEmailSender<com.mailjet.client.MailjetRequest,com.mailjet.client.MailjetResponse>
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
NAME
MailjetEmailSender name. |
Constructor and Description |
---|
MailjetEmailSender(MailjetConfiguration mailjetConfiguration,
MailjetEmailComposer mailjetEmailComposer) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getName() |
com.mailjet.client.MailjetResponse |
send(@NotNull @Valid Email email,
@NotNull java.util.function.Consumer<com.mailjet.client.MailjetRequest> emailRequest)
Sends an email.
|
org.reactivestreams.Publisher<com.mailjet.client.MailjetResponse> |
sendAsync(@NotNull @Valid Email email,
@NotNull java.util.function.Consumer<com.mailjet.client.MailjetRequest> emailRequest)
Sends an email.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
send
sendAsync
public static final java.lang.String NAME
MailjetEmailSender
name.public MailjetEmailSender(MailjetConfiguration mailjetConfiguration, MailjetEmailComposer mailjetEmailComposer)
mailjetConfiguration
- Mailjet Configuration.mailjetEmailComposer
- Mailjet Request Composer@NonNull public java.lang.String getName()
getName
in interface io.micronaut.core.naming.Named
@NonNull public com.mailjet.client.MailjetResponse send(@NonNull @NotNull @Valid @NotNull @Valid Email email, @NonNull @NotNull @NotNull java.util.function.Consumer<com.mailjet.client.MailjetRequest> emailRequest) throws EmailException
TransactionalEmailSender
send
in interface TransactionalEmailSender<com.mailjet.client.MailjetRequest,com.mailjet.client.MailjetResponse>
email
- EmailemailRequest
- Email Request ConsumerEmailException
- Wrapper of any exception thrown while sending email@NonNull public org.reactivestreams.Publisher<com.mailjet.client.MailjetResponse> sendAsync(@NonNull @NotNull @Valid @NotNull @Valid Email email, @NonNull @NotNull @NotNull java.util.function.Consumer<com.mailjet.client.MailjetRequest> emailRequest) throws EmailException
AsyncTransactionalEmailSender
sendAsync
in interface AsyncTransactionalEmailSender<com.mailjet.client.MailjetRequest,com.mailjet.client.MailjetResponse>
email
- EmailemailRequest
- Email Request ConsumerEmailException
- Wrapper of any exception thrown while sending email