@Requires(beans={SendGridConfiguration.class,SendgridEmailComposer.class})
@Named(value="sendgrid")
@Singleton
public class SendgridEmailSender
extends java.lang.Object
implements TransactionalEmailSender<com.sendgrid.Request,com.sendgrid.Response>, AsyncTransactionalEmailSender<com.sendgrid.Request,com.sendgrid.Response>
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
NAME
SendgridEmailSender name. |
| Constructor and Description |
|---|
SendgridEmailSender(SendGridConfiguration sendGridConfiguration,
SendgridEmailComposer sendgridEmailComposer) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getName() |
com.sendgrid.Response |
send(@NotNull @Valid Email email,
@NotNull java.util.function.Consumer<com.sendgrid.Request> emailRequest)
Sends an email.
|
org.reactivestreams.Publisher<com.sendgrid.Response> |
sendAsync(@NotNull @Valid Email email,
@NotNull java.util.function.Consumer<com.sendgrid.Request> emailRequest)
Sends an email.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitsendsendAsyncpublic static final java.lang.String NAME
SendgridEmailSender name.public SendgridEmailSender(SendGridConfiguration sendGridConfiguration, SendgridEmailComposer sendgridEmailComposer)
sendGridConfiguration - SendGrid ConfigurationsendgridEmailComposer - SendGrid Email composer@NonNull public java.lang.String getName()
getName in interface io.micronaut.core.naming.Named@NonNull
public com.sendgrid.Response send(@NonNull @NotNull @Valid
@NotNull @Valid Email email,
@NonNull @NotNull
@NotNull java.util.function.Consumer<com.sendgrid.Request> emailRequest)
throws EmailException
TransactionalEmailSendersend in interface TransactionalEmailSender<com.sendgrid.Request,com.sendgrid.Response>email - EmailemailRequest - Email Request ConsumerEmailException - Wrapper of any exception thrown while sending email@NonNull
public org.reactivestreams.Publisher<com.sendgrid.Response> sendAsync(@NonNull @NotNull @Valid
@NotNull @Valid Email email,
@NonNull @NotNull
@NotNull java.util.function.Consumer<com.sendgrid.Request> emailRequest)
throws EmailException
AsyncTransactionalEmailSendersendAsync in interface AsyncTransactionalEmailSender<com.sendgrid.Request,com.sendgrid.Response>email - EmailemailRequest - Email Request ConsumerEmailException - Wrapper of any exception thrown while sending email