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:

POST/postmark/webhook
Connect to Postmark (shared or dedicated) and send email

What 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). Set fromEmail 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

FieldApplies toDescription
serverTypeallshared (default) or dedicated.
apiTokendedicatedYour Postmark Server API Token. Supports {{env.MY_SECRET}} references.
fromEmailallDefault From address — a verified Postmark sender signature.
messageStreamallOptional. Outbound message stream (default outbound).
baseUrlallOptional. 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 (alias send) — send a single message. Provide to, subject, and an htmlBody and/or textBody (body is accepted as an alias for HTML). from defaults to the configured sender signature; optional cc, bcc, replyTo, tag, and messageStream. Returns messageId, submittedAt, and to.
  • sendEmails (alias sendBatch) — send a batch. Provide a messages array (each like a sendEmail call) or a to list with a shared subject and body. Returns sent, failed, and per-message results.
  • 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 the X-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 /server endpoint 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 call sendEmail.