Package io.micronaut.email
Interface EmailSender<I,O>
- Type Parameters:
I
- Email RequestO
- Email Response
- All Superinterfaces:
io.micronaut.core.naming.Named
- All Known Implementing Classes:
DefaultEmailSender
public interface EmailSender<I,O>
extends io.micronaut.core.naming.Named
API to send transactional emails synchronously.
- Since:
- 1.0.0
- Author:
- Sergio del Amo
-
Method Summary
Modifier and TypeMethodDescriptiondefault O
send
(Email.Builder emailBuilder) Sends an email.send
(Email.Builder emailBuilder, @NonNull @NotNull Consumer<I> emailRequest) Sends an email.Methods inherited from interface io.micronaut.core.naming.Named
getName
-
Method Details
-
send
Sends an email.- Parameters:
emailBuilder
- Email Builder- Returns:
- Response Object or empty optional if an error occurred
- Throws:
EmailException
- Wrapper of any exception thrown while sending email
-
send
@NonNull O send(@NonNull @NotNull Email.Builder emailBuilder, @NonNull @NotNull @NonNull @NotNull Consumer<I> emailRequest) throws EmailException Sends an email.- 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
-