Postmark
Send a compiled Maizzle template through the Postmark HTTP API.
Install
bash
npm install postmark @maizzle/framework
Render and send
ts
import { render } from '@maizzle/framework'
import { ServerClient } from 'postmark'
const client = new ServerClient(process.env.POSTMARK_TOKEN)
const { html, plaintext } = await render('emails/welcome.vue')
await client.sendEmail({
From: '[email protected]',
To: '[email protected]',
Subject: 'Welcome',
HtmlBody: html,
TextBody: plaintext,
MessageStream: 'outbound',
})
Postmark requires verified sender signatures and uses separate streams for transactional vs. broadcast mail — set MessageStream accordingly.