Package io.micronaut.email.ses
Class AsyncSesEmailSender
java.lang.Object
io.micronaut.email.ses.AsyncSesEmailSender
- All Implemented Interfaces:
io.micronaut.core.naming.Named
,AsyncTransactionalEmailSender<software.amazon.awssdk.services.ses.model.SesRequest,
software.amazon.awssdk.services.ses.model.SesResponse>
@Named("ses")
@Requires(beans=software.amazon.awssdk.services.ses.SesAsyncClient.class)
@Singleton
public class AsyncSesEmailSender
extends Object
implements AsyncTransactionalEmailSender<software.amazon.awssdk.services.ses.model.SesRequest,software.amazon.awssdk.services.ses.model.SesResponse>
Amazon Simple Email Service implementation of @link io.micronaut.email.AsyncTransactionalEmailSender}.
- Since:
- 1.0.0
- Author:
- Sergio del Amo
-
Field Summary
-
Constructor Summary
ConstructorDescriptionAsyncSesEmailSender
(software.amazon.awssdk.services.ses.SesAsyncClient ses, SesEmailComposer messageComposer) -
Method Summary
Modifier and TypeMethodDescription@NonNull String
getName()
@NonNull org.reactivestreams.Publisher<software.amazon.awssdk.services.ses.model.SesResponse>
sendAsync
(@NonNull @NotNull @Valid Email email, @NonNull @NotNull Consumer<software.amazon.awssdk.services.ses.model.SesRequest> 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
-
Field Details
-
NAME
AsyncSesEmailSender
name.- See Also:
-
-
Constructor Details
-
AsyncSesEmailSender
public AsyncSesEmailSender(software.amazon.awssdk.services.ses.SesAsyncClient ses, SesEmailComposer messageComposer) - Parameters:
ses
- Amazon Simple Email Service ClientmessageComposer
- Message Composer
-
-
Method Details
-
getName
- Specified by:
getName
in interfaceio.micronaut.core.naming.Named
-
sendAsync
@NonNull @SingleResult public @NonNull org.reactivestreams.Publisher<software.amazon.awssdk.services.ses.model.SesResponse> sendAsync(@NonNull @NotNull @Valid @NonNull @NotNull @Valid Email email, @NonNull @NotNull @NonNull @NotNull Consumer<software.amazon.awssdk.services.ses.model.SesRequest> emailRequest) throws EmailException Sends an email.- Specified by:
sendAsync
in interfaceAsyncTransactionalEmailSender<software.amazon.awssdk.services.ses.model.SesRequest,
software.amazon.awssdk.services.ses.model.SesResponse> - Parameters:
email
- EmailemailRequest
- Email Request Consumer- Returns:
SendRawEmailResponse
orSendEmailResponse
or empty optional if an error occurred- Throws:
EmailException
- Wrapper of any exception thrown while sending email
-