Package io.micronaut.email.postmark
Class PostmarkEmailSender
java.lang.Object
io.micronaut.email.AbstractTransactionalEmailSender<com.postmarkapp.postmark.client.data.model.message.Message,com.postmarkapp.postmark.client.data.model.message.MessageResponse>
io.micronaut.email.postmark.PostmarkEmailSender
- All Implemented Interfaces:
io.micronaut.core.naming.Named
,AsyncTransactionalEmailSender<com.postmarkapp.postmark.client.data.model.message.Message,
,com.postmarkapp.postmark.client.data.model.message.MessageResponse> TransactionalEmailSender<com.postmarkapp.postmark.client.data.model.message.Message,
com.postmarkapp.postmark.client.data.model.message.MessageResponse>
@Named("postmark")
@Requires(beans={PostmarkConfiguration.class,PostmarkEmailComposer.class})
@Singleton
public class PostmarkEmailSender
extends AbstractTransactionalEmailSender<com.postmarkapp.postmark.client.data.model.message.Message,com.postmarkapp.postmark.client.data.model.message.MessageResponse>
- Since:
- 1.0.0
- Author:
- Sergio del Amo
-
Field Summary
-
Constructor Summary
ConstructorDescriptionPostmarkEmailSender
(ExecutorService executorService, PostmarkConfiguration postmarkConfiguration, PostmarkEmailComposer postmarkEmailComposer) -
Method Summary
Methods inherited from class io.micronaut.email.AbstractTransactionalEmailSender
sendAsync
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.email.TransactionalEmailSender
send
-
Field Details
-
NAME
PostmarkEmailSender
name.- See Also:
-
-
Constructor Details
-
PostmarkEmailSender
public PostmarkEmailSender(@Named("io") ExecutorService executorService, PostmarkConfiguration postmarkConfiguration, PostmarkEmailComposer postmarkEmailComposer) - Parameters:
executorService
- Executor servicepostmarkConfiguration
- Postmark configurationpostmarkEmailComposer
- Postmark Email Composer
-
-
Method Details
-
getName
-
send
@NonNull public @NonNull com.postmarkapp.postmark.client.data.model.message.MessageResponse send(@NonNull @NotNull @Valid @NonNull @NotNull @Valid Email email, @NonNull @NotNull @NonNull @NotNull Consumer<com.postmarkapp.postmark.client.data.model.message.Message> emailRequest) throws EmailException Description copied from interface:TransactionalEmailSender
Sends an email.- 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
-