Package io.micronaut.email
Class DefaultAsyncEmailSender<I,O>
java.lang.Object
io.micronaut.email.DefaultAsyncEmailSender<I,O>
- Type Parameters:
I
- Email RequestO
- Email Response
- All Implemented Interfaces:
io.micronaut.core.naming.Named
,AsyncEmailSender<I,
O>
@EachBean(AsyncTransactionalEmailSender.class)
public class DefaultAsyncEmailSender<I,O>
extends Object
implements AsyncEmailSender<I,O>
Decorates with every
EmailDecorator
and send an email via a AsyncTransactionalEmailSender
.- Since:
- 1.0.0
- Author:
- Sergio del Amo
-
Constructor Summary
ConstructorDescriptionDefaultAsyncEmailSender
(AsyncTransactionalEmailSender<I, O> transactionalEmailSender, List<EmailDecorator> decorators) -
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.AsyncEmailSender
sendAsync
-
Constructor Details
-
DefaultAsyncEmailSender
public DefaultAsyncEmailSender(AsyncTransactionalEmailSender<I, O> transactionalEmailSender, List<EmailDecorator> decorators) - Parameters:
transactionalEmailSender
- Transactional Email Senderdecorators
- Email decorators
-
-
Method Details
-
sendAsync
@NonNull @SingleResult public @NonNull org.reactivestreams.Publisher<O> sendAsync(@NonNull @NotNull Email.Builder emailBuilder, @NonNull @NotNull @NonNull @NotNull Consumer<I> emailRequest) throws EmailException Description copied from interface:AsyncEmailSender
Sends an email.- Specified by:
sendAsync
in interfaceAsyncEmailSender<I,
O> - Parameters:
emailBuilder
- Email BuilderemailRequest
- Email Request- Returns:
- Response Object or empty optional if an error occurred
- Throws:
EmailException
- Wrapper of any exception thrown while sending email
-
getName
- Specified by:
getName
in interfaceio.micronaut.core.naming.Named
-