---
title: Postmark
description: Configure the fetch-based Postmark adapter.
sidebar:
  icon: "https://www.google.com/s2/favicons?domain=postmarkapp.com&sz=64"
---

The Postmark adapter calls the Postmark Email API directly. It does not add a runtime dependency.



**[Postmark](https://postmarkapp.com)** · `@opencoredev/email-sdk/postmark` · [setup guide](/docs/adapters/postmark)



```ts
import { createEmailClient } from "@opencoredev/email-sdk";
import { postmark } from "@opencoredev/email-sdk/postmark";

const email = createEmailClient({
  adapters: [
    postmark({
      serverToken: process.env.POSTMARK_SERVER_TOKEN!,
      messageStream: "outbound",
    }),
  ],
});
```

## Send

```ts
await email.send({
  from: "Acme <hello@acme.com>",
  to: "user@example.com",
  subject: "Receipt",
  html: "<p>Thanks for your order.</p>",
  metadata: {
    orderId: "ord_123",
  },
});
```

## Options

| Option          | Type                     | Required | Notes                                      |
| --------------- | ------------------------ | -------- | ------------------------------------------ |
| `serverToken`   | `string`                 | Yes      | Postmark server token.                     |
| `baseUrl`       | `string`                 | No       | Defaults to `https://api.postmarkapp.com`. |
| `messageStream` | `string`                 | No       | Postmark message stream.                   |
| `fetch`         | `typeof fetch`           | No       | Useful for tests or custom runtimes.       |
| `headers`       | `Record<string, string>` | No       | Extra request headers.                     |

## Response

The adapter maps Postmark `MessageID` to `id` and `messageId`.
