Package io.micronaut.email.mailjet
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 Summary
-
Constructor Summary
ConstructorDescriptionMailjetEmailSender
(MailjetConfiguration mailjetConfiguration, MailjetEmailComposer mailjetEmailComposer) -
Method Summary
Modifier and TypeMethodDescription@NonNull String
getName()
@NonNull com.mailjet.client.MailjetResponse
send
(@NonNull @NotNull @Valid Email email, @NonNull @NotNull Consumer<com.mailjet.client.MailjetRequest> emailRequest) Sends an email.@NonNull org.reactivestreams.Publisher<com.mailjet.client.MailjetResponse>
sendAsync
(@NonNull @NotNull @Valid Email email, @NonNull @NotNull Consumer<com.mailjet.client.MailjetRequest> emailRequest) Sends an email.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.micronaut.email.AsyncTransactionalEmailSender
sendAsync
Methods inherited from interface io.micronaut.email.TransactionalEmailSender
send
-
Field Details
-
NAME
MailjetEmailSender
name.- See Also:
-
-
Constructor Details
-
MailjetEmailSender
public MailjetEmailSender(MailjetConfiguration mailjetConfiguration, MailjetEmailComposer mailjetEmailComposer) - Parameters:
mailjetConfiguration
- Mailjet Configuration.mailjetEmailComposer
- Mailjet Request Composer
-
-
Method Details
-
getName
- Specified by:
getName
in interfaceio.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 interfaceTransactionalEmailSender<com.mailjet.client.MailjetRequest,
com.mailjet.client.MailjetResponse> - Parameters:
email
- EmailemailRequest
- 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 interfaceAsyncTransactionalEmailSender<com.mailjet.client.MailjetRequest,
com.mailjet.client.MailjetResponse> - Parameters:
email
- EmailemailRequest
- Email Request Consumer- Returns:
- Response Object or empty optional if an error occurred
- Throws:
EmailException
- Wrapper of any exception thrown while sending email
-