Postmark email provider adapter for Ghost with batch email support.
- Batch Email Sending: Send up to 500 emails per batch using Postmark's batch API
- Email Analytics: Fetch email events for delivery, opens, clicks, bounces, and spam complaints
- Ghost Integration: Seamlessly integrates with Ghost's email adapter pattern
- Personalization: Full support for Ghost's replacement variables (merge tags)
- Zero Ghost Footprint: No Postmark code in Ghost core - loaded dynamically from npm
cd ghost/core
npm install ghost-email-postmarkcd ghost/core
npm install /path/to/ghost-email-postmarkcd /path/to/ghost-email-postmark
npm link
cd /path/to/ghost/ghost/core
npm link ghost-email-postmarkGhost will automatically load the adapter from node_modules when configured.
Add to your config.[env].json:
{
"bulkEmail": {
"provider": "ghost-email-postmark",
"postmark": {
"serverToken": "your-postmark-server-token",
"messageStream": "outbound",
"apiUrl": "https://api.postmarkapp.com"
},
"batchSize": 500,
"targetDeliveryWindow": 3600
}
}Ghost will automatically:
- Detect
ghost-email-postmarkas the provider - Load the adapter from
node_modules/ghost-email-postmark - Validate it implements the required methods
- Use it for email sending and analytics
That's it! No code changes needed in Ghost.
Ghost's adapter manager automatically:
- Checks
node_modulesfor the adapter package - Loads the adapter class
- Validates it has
requiredFnsproperty - Validates all required methods are implemented
- Instantiates the adapter with Ghost config
The adapter implements Ghost's email provider interface:
class PostmarkAdapter {
static requiredFns = ['send', 'getMaximumRecipients', 'getTargetDeliveryWindow', 'fetchLatest'];
async send(data, options) { }
getMaximumRecipients() { }
getTargetDeliveryWindow() { }
async fetchLatest(batchHandler, options) { }
}serverToken: Your Postmark Server API token
messageStream: Message stream to use (default: "outbound")apiUrl: Postmark API URL (default: "https://api.postmarkapp.com")batchSize: Maximum recipients per batch (default: 500)targetDeliveryWindow: Delivery window in seconds for rate limiting (default: 0)
The adapter uses Postmark's batch email API:
- Applies replacements individually per recipient
- Uses batch endpoint (
/email/batch) for multiple recipients - Uses single email endpoint (
/email) for one recipient - Returns message ID
Features:
- Up to 500 recipients per batch
- Individual personalization per recipient
- Open and click tracking
- Metadata for analytics
- Fetches messages from Postmark Messages API (500 per page)
- Gets detailed events for each message
- Normalizes events to Ghost format
- Processes events in batches
| Postmark Event | Ghost Event | Description |
|---|---|---|
| Delivered | delivered | Successfully delivered |
| Bounced | failed | Delivery failed (bounce) |
| Opened | opened | Email opened |
| LinkClicked | clicked | Link clicked |
| SpamComplaint | complained | Marked as spam |
| SubscriptionChange | unsubscribed | Unsubscribed |
-
Link the package:
cd /path/to/ghost-email-postmark npm link -
Link in Ghost:
cd /path/to/ghost/ghost/core npm link ghost-email-postmark -
Configure Ghost:
{ "bulkEmail": { "provider": "ghost-email-postmark", "postmark": { "serverToken": "your-test-token" } } } -
Start Ghost and test
cd /path/to/ghost-email-postmark
npm publishMIT
For issues specific to this adapter:
- GitHub Issues: https://github.com/madewithlove/ghost-email-postmark/issues
For Postmark API issues:
- Postmark Support: https://postmarkapp.com/support
For Ghost integration issues:
- Ghost Documentation: https://ghost.org/docs/