Postmark Email Service
class PostmarkEmailService<C : KlerkContext, V>(apiKey: String, webhooksAuth: PostmarkEmailWebhooksAuth, serverID: Int? = null, val defaultFromAddress: BasicEmail.EmailAndName, messageStream: String = "outbound") : AdminUIPluginIntegration<C, V> , EmailSender<C, V>
Plugin for sending transactional email via Postmark.
Adds a block-function 'sendEmail' so that it is easy to trigger emails via your state machines:
onEvent(ApproveInvoice) {
sendEmail(::generateNotificationEmail)
transitionTo(Approved)
}
Content copied to clipboard
It is also possible to send via a normal Klerk command:
klerk.handle(
Command(
event = PostmarkEmailService.CreateEmail,
model = null,
params = CreateEmailParams.from(PostmarkEmail(
...
Content copied to clipboard
When an email should be sent, a PluginPostmarkEmail model is and a Job is created to process the email in a fault-tolerant way. The model will be deleted some time after the email has been processed.
Parameters
server ID
is not required, but there will be no link in AdminUI to the email details page on postmarkapp.com unless it is provided.
Constructors
Link copied to clipboard
constructor(apiKey: String, webhooksAuth: PostmarkEmailWebhooksAuth, serverID: Int? = null, defaultFromAddress: BasicEmail.EmailAndName, messageStream: String = "outbound")