Postmark
Postmark as a planned MainSDK email driver - sender domain, server token, main.yaml, testing and swapping.
Postmark is a hosted email delivery service focused on transactional mail. It is named as an email driver in the MainSDK requirements, so email.send() and email.marketing() could deliver through it. Pick it if your team already sends through Postmark.
Interfaces it serves
Pick Postmark in main.yaml for any of these. Your calls stay the same, and you can swap later.
emailBuilding for 0.3Driver postmark PostmarkPlanned driver
email:
driver: postmarkSwap to another provider
mailBuilding for 1.2Driver postmark Postmark inbound
mail:
driver: postmarkBefore you start
- Create a Postmark server for this app and copy its server API token.
- Add your sending domain and the DNS records Postmark gives you (DKIM and a return-path record).
- Postmark separates transactional and broadcast mail into message streams; marketing email belongs on a broadcast stream.
Store the token in your secrets manager.
Configure
email:
driver: postmark # planned driver, not in the spec yet
key: secret:POSTMARK_SERVER_TOKEN # suggested nameA literal key fails to load with MAIN-CONFIG-0004.
Use it
import { email } from "mainsdk";
await email.send({ to: user.email, template: "receipt", data: { orderId: order.id } });Local development and testing
mainsdk dev sends every email to the local inbox. createTestApp() from @mainsdk/testing runs email on its in-memory fake, and chaos.on("email", { outage: true }) simulates an outage.
What MainSDK adds on top
- Marketing email does not compile without an unsubscribe.
- Unsubscribes, bounces and complaints suppressed for every later send.
- No tracking pixels or rewritten links by default; a retry never sends twice.
See Email.
Limits and notes
- Planned driver, not in the spec yet. The email-notify spec ships Resend, Amazon SES and the local inbox; Postmark comes through the driver kit later.
- How marketing sends map to a Postmark message stream is not decided yet.
Swap to or from it
email:
driver: resend # was postmarkEmail is stateless, so the swap needs no migration; verify your domain with the new provider first.
FAQ
Can I use Postmark today? Not through MainSDK yet. Use Resend or Amazon SES.
Next
- Resend, Amazon SES and SMTP
Open questions
Was this page helpful?