Package io.micronaut.email
Class AbstractTransactionalEmailSender<I,O>
java.lang.Object
io.micronaut.email.AbstractTransactionalEmailSender<I,O>
- Type Parameters:
I
- Email RequestO
- Email Response
- All Implemented Interfaces:
io.micronaut.core.naming.Named
,AsyncTransactionalEmailSender<I,
,O> TransactionalEmailSender<I,
O>
- Direct Known Subclasses:
JavaxEmailSender
,PostmarkEmailSender
public abstract class AbstractTransactionalEmailSender<I,O>
extends Object
implements AsyncTransactionalEmailSender<I,O>, TransactionalEmailSender<I,O>
Abstract class which implements both
TransactionalEmailSender
and AsyncTransactionalEmailSender
.
It provides an implemeentation of AsyncTransactionalEmailSender.sendAsync(Email, Consumer)
by subscribing on an IO scheduler.- Since:
- 1.0.0
- Author:
- Sergio del Amo
-
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractTransactionalEmailSender
(ExecutorService executorService) -
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.AsyncTransactionalEmailSender
sendAsync
Methods inherited from interface io.micronaut.core.naming.Named
getName
Methods inherited from interface io.micronaut.email.TransactionalEmailSender
send, send
-
Constructor Details
-
AbstractTransactionalEmailSender
- Parameters:
executorService
- Executor service
-
-
Method Details
-
sendAsync
@NonNull @SingleResult public @NonNull org.reactivestreams.Publisher<O> sendAsync(@NonNull @NotNull @NonNull @NotNull Email email, @NonNull @NotNull @NonNull @NotNull Consumer<I> emailRequest) throws EmailException Description copied from interface:AsyncTransactionalEmailSender
Sends an email.- Specified by:
sendAsync
in interfaceAsyncTransactionalEmailSender<I,
O> - 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
-