Platform services

Email

The Email service lets your services send transactional email. It exposes send functions that other services can call, and delivers the messages through a provider — currently Postmark.

What it does

Email is a function-oriented service: it exposes named functions that the rest of your project can call. Dreambase delivers a FUNCTION_CALL eventto the service's webhook, and the service sends the requested message through the provider.

Providers

  • Postmark — transactional email via a shared or dedicated Postmark server, with send, batch send, and delivery-stats functions plus health checks and metrics.

NestJS on Vercel

The Email service is a NestJS application deployed as a Vercel serverless function, following the same pattern as the other Dreambase integrations. Each provider handles its own webhook route (e.g. /postmark/webhook).

Endpoint

POST/postmark/webhook
Postmark handler — challenge, deployment, health, metrics & function calls

Functions it exposes

  • sendEmail (alias send) — send a single email with to, subject, and an htmlBody and/or textBody. from defaults to the configured sender signature.
  • sendEmails (alias sendBatch) — send a batch, taking a messages array or a to list with a shared subject and body.
  • getDeliveryStats — return outbound delivery statistics.

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>"
    }
  }
}

Events it handles

  • WEBHOOK_CHALLENGE — echo the challenge back to verify the endpoint.
  • DEPLOYMENT_CREATED / DEPLOYMENT_DELETED — verify the token and publish (or remove) the connection outputs.
  • HEALTH_CHECK / METRIC_UPDATE — report reachability and delivery metrics.
  • FUNCTION_CALL — dispatch to a send function and deliver via the provider.

Wire it into any service

Because Email 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 Email service holds the provider configuration and your other services just call sendEmail.