Package io.micronaut.email.ses
Class SesEmailSender
java.lang.Object
io.micronaut.email.ses.SesEmailSender
- All Implemented Interfaces:
io.micronaut.core.naming.Named
,TransactionalEmailSender<software.amazon.awssdk.services.ses.model.SesRequest,
software.amazon.awssdk.services.ses.model.SesResponse>
@Named("ses")
@Requires(beans=software.amazon.awssdk.services.ses.SesClient.class)
@Singleton
public class SesEmailSender
extends Object
implements TransactionalEmailSender<software.amazon.awssdk.services.ses.model.SesRequest,software.amazon.awssdk.services.ses.model.SesResponse>
Amazon Simple Email Service implementation of
TransactionalEmailSender
.- Since:
- 1.0.0
- Author:
- Sergio del Amo
-
Field Summary
-
Constructor Summary
ConstructorDescriptionSesEmailSender
(software.amazon.awssdk.services.ses.SesClient ses, SesEmailComposer messageComposer) -
Method Summary
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.TransactionalEmailSender
send
-
Field Details
-
NAME
SesEmailSender
name.- See Also:
-
-
Constructor Details
-
SesEmailSender
public SesEmailSender(software.amazon.awssdk.services.ses.SesClient ses, SesEmailComposer messageComposer) - Parameters:
ses
- Amazon Simple Email Service ClientmessageComposer
- Message Composer
-
-
Method Details
-
getName
- Specified by:
getName
in interfaceio.micronaut.core.naming.Named
-
send
@NonNull public @NonNull software.amazon.awssdk.services.ses.model.SesResponse send(@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:
send
in interfaceTransactionalEmailSender<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
-