> ## Documentation Index
> Fetch the complete documentation index at: https://docs.alpacarelay.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Postmark

> Connect Postmark with a server API token to import standard templates and push AlpacaRelay designs back as templates.

Connecting Postmark lets you import the templates on a Postmark server and push AlpacaRelay designs back out as templates you can send with.

<Info>
  New to integrations? The [overview](/integrations/overview) explains the import and export flows that are the same for every provider. This page covers what's specific to Postmark.
</Info>

## What you need

* A Postmark account. The free Developer plan is enough — templates aren't metered, and AlpacaRelay never sends through your account.
* A **Server API token** from the specific server whose templates you want to work with.

Postmark has no OAuth. It authenticates with tokens only, so you create a token and paste it in once.

<Warning>
  Use a **Server** token, not an **Account** token. They look alike but do different jobs: account tokens manage servers and billing, while every call this integration makes is server-level. An account token fails to connect.
</Warning>

## Get the server token

<Steps>
  <Step title="Pick or create a server">
    In Postmark, go to **Servers**. Templates belong to one server, so the token you choose decides which templates AlpacaRelay sees.

    Creating a new server for this? Tick **Sandbox**. A sandbox server accepts and reports messages normally but routes them nowhere, which makes it safe for the test-send button inside Postmark's own template editor.
  </Step>

  <Step title="Open the API Tokens tab">
    Select your server, then open **API Tokens**.
  </Step>

  <Step title="Copy the server API token">
    Copy it. Unlike some providers, Postmark lets you return to this page later.
  </Step>
</Steps>

## Connect Postmark

<Steps>
  <Step title="Open Connected apps">
    Go to **Settings** → **Connected apps**, then click **Connect app**.
  </Step>

  <Step title="Choose Postmark">
    A secure form opens, asking for your token.
  </Step>

  <Step title="Paste the server token">
    Submit it. AlpacaRelay verifies the token immediately by reading the server.
  </Step>

  <Step title="Check the badge">
    Postmark appears in your connected apps with a **Connected** badge and the name of the server you connected.
  </Step>
</Steps>

<Tip>
  The server name on the badge is how you confirm you connected the right one. If you keep templates on separate servers for staging and production, that name is the only thing distinguishing them.
</Tip>

Because a connection is scoped to one server, and a workspace holds one Postmark connection, you can reach one server's templates at a time. Disconnect and reconnect with a different token to switch servers.

## Export a design to Postmark

Save the email, then open **Send to app** from the editor's name dropdown or the **⋯** menu on an email card, and click **Create template** on the Postmark row.

The export creates a **standard template** on the connected server, which you'll find under **Templates**. **Re-sync** updates that same template in place, so code sending by template alias or ID picks up the new design.

<Warning>
  **Known limitation.** Postmark doesn't store a template body as plain HTML — it parses the body as a [Mustachio template](https://postmarkapp.com/support/article/1077-template-syntax) and validates the syntax when the template is saved. A body it can't parse is rejected, and the export fails.

  This most often bites on a **round trip**: Postmark's own starter templates are full of `{{ }}` tags by design, so a template imported from Postmark carries them back out again, and a tag that gets reshaped anywhere along the way stops parsing.

  If an export to Postmark fails while your other providers succeed, this is the likely cause. Check the design for `{{ }}` tags, and check Postmark's activity log for a `422` with error code `1122`. We're working on handling this in the Postmark export itself. Exporting the same design to Mailchimp, Klaviyo, or SendGrid is unaffected — they store HTML verbatim.
</Warning>

Postmark limits each server to **100 templates**. Exports fail once you hit it, so prune templates you no longer send.

## Import a template from Postmark

Click **Import** when creating an email, choose **Postmark** under **Integrations**, and pick a template.

The picker lists the **standard** templates on the connected server. Postmark's API exposes no thumbnails, so rows show names without previews.

<Note>
  **Layouts** are listed separately from standard templates, not mixed in. A layout is a wrapper that other templates slot into rather than a complete email, so importing one gives you the frame without content.
</Note>

Postmark starter templates contain Mustachio placeholders such as `{{name}}`. They import as literal text — AlpacaRelay doesn't interpret them. That's expected, though see the export warning above before pushing such a design back.

## Troubleshooting

<AccordionGroup>
  <Accordion title="Connecting failed immediately">
    Almost always an **Account** token instead of a **Server** token. Go to **Servers** → your server → **API Tokens** and copy from there, not from **Account** → **API Tokens**.
  </Accordion>

  <Accordion title="The import picker is empty">
    The connected server has no standard templates yet. Add one in Postmark — a starter template saved unedited is enough — or check whether your templates live on a different server.
  </Accordion>

  <Accordion title="Export fails while other providers work">
    Postmark's template parser is rejecting the body. See the known limitation above.
  </Accordion>

  <Accordion title="Export started failing after a while">
    You may have hit the 100-templates-per-server limit. Delete unused templates in Postmark and retry.
  </Accordion>

  <Accordion title="I need templates from a different server">
    Disconnect Postmark, then connect again with that server's token. Links to the old server's templates won't resolve — unlink them and create fresh templates.
  </Accordion>
</AccordionGroup>
