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