Email service
Postmark
The Postmark integration lets your project send transactional email — with a shared, Dreambase-managed server or a dedicated Server API Token you provide — exposes the connection details as outputs, and offers single sends, batch sends, and delivery-stats lookups via function calls, plus health checks and delivery metrics.
Postmark is one of the Email service integrations. It handles its own webhook route:
/postmark/webhookWhat it does
On DEPLOYMENT_CREATEDthe service resolves the token (shared or dedicated), verifies it against Postmark's /server endpoint, and publishes the connection details — apiToken, fromEmail, apiUrl, and messageStream — back to Dreambase as outputs for other services to send through. The deployment connects to the provider API; there is no infrastructure to provision.
Instance type
- shared (default) — use the Dreambase-managed Postmark server (
POSTMARK_SHARED_API_TOKEN). Ideal for MVPs and development, with no setup required. - dedicated — bring your own Postmark Server API Token.
Sender signature
Postmark only delivers mail from a verified sender signature (or a verified domain). SetfromEmail to that address; it becomes the default From for every send. The deployment warns (but does not fail) if no fromEmail is configured, so the connection can still expose stats while you verify a signature.Inputs
| Field | Applies to | Description |
|---|---|---|
serverType | all | shared (default) or dedicated. |
apiToken | dedicated | Your Postmark Server API Token. Supports {{env.MY_SECRET}} references. |
fromEmail | all | Default From address — a verified Postmark sender signature. |
messageStream | all | Optional. Outbound message stream (default outbound). |
baseUrl | all | Optional. Override the API base URL (default https://api.postmarkapp.com). |
Outputs
apiToken— the resolved Postmark Server API Token.fromEmail— the default sender signature.apiUrl— the base URL used for API requests.messageStream— the outbound message stream.
Functions
Callable via a FUNCTION_CALL event:
sendEmail(aliassend) — send a single message. Provideto,subject, and anhtmlBodyand/ortextBody(bodyis accepted as an alias for HTML).fromdefaults to the configured sender signature; optionalcc,bcc,replyTo,tag, andmessageStream. ReturnsmessageId,submittedAt, andto.sendEmails(aliassendBatch) — send a batch. Provide amessagesarray (each like asendEmailcall) or atolist with a sharedsubjectand body. Returnssent,failed, and per-messageresults.getDeliveryStats— return outbound delivery statistics (sent,bounced,bounceRate,spamComplaints,opens,tracked).
A function call arrives as an event shaped like this:
POST /postmark/webhook
{
"name": "FUNCTION_CALL",
"functionCall": {
"name": "sendEmail",
"arguments": {
"to": "user@example.com",
"subject": "Welcome",
"htmlBody": "<h1>Hello, World!</h1>"
}
}
}Metrics
On METRIC_UPDATEthe service reads Postmark's outbound statistics and reports emails_sent, emails_bounced, bounce_rate (%), and spam_complaints.
Authentication
Requests are authenticated with theX-Postmark-Server-Token header, per the Postmark API. Only server-token endpoints are used (/email, /email/batch, /server, /stats/outbound).Events it handles
WEBHOOK_CHALLENGE— verify the webhook endpoint.HEALTH_CHECK— probe the Postmark/serverendpoint with the configured token.METRIC_UPDATE— report outbound delivery metrics.DEPLOYMENT_CREATED— verify the token and publish the connection details as outputs.DEPLOYMENT_DELETED— stop tracking the connection (nothing external is torn down).FUNCTION_CALL— run a named function.
Wire it into any service
Because Postmark is exposed as functions, any service in your design can send mail — a sign-up flow, an alerting worker, a billing job — without embedding email credentials of its own. The Postmark service holds the configuration and your other services just callsendEmail.