Postmark
Let an agent send transactional email without the keys to your whole account. It searches sent email, bounces and stats, sends an email or a template email to one recipient, and suppresses or reactivates addresses, and every send can wait for a person.
- host
- api.postmarkapp.com
- connect
- API key, per user
Send email
postmark-send-email
Send template email
postmark-send-template-email
Activate bounce
postmark-activate-bounce
Suppress recipient
postmark-suppress-recipient
Reads and writes in Postmark. Writes are off until you switch them on.
Each one is a named operation from the pack. Reads change nothing.
Writes
Send email
read backpostmark-send-email
Send one email to one recipient from a confirmed sender signature or domain, in a message stream. Give text_body, html_body or both. Returns the MessageID.
Send template email
read backpostmark-send-template-email
Send one email to one recipient from a server template, filled with template_model. Give template_id or template_alias. Returns the MessageID.
Activate bounce
read backpostmark-activate-bounce
Reactivate an address Postmark deactivated after a bounce, so email to it is sent again. A bounce can be reactivated when its CanActivate is true.
Suppress recipient
read backpostmark-suppress-recipient
Stop a stream from sending to one address (a manual suppression). Email to it is then refused until the suppression is removed.
Unsuppress recipient
read backpostmark-unsuppress-recipient
Remove one address from a stream's suppressions, so email to it is sent again. A suppression for a spam complaint cannot be removed.
Reads
List message streams
postmark-list-message-streams
List the server's message streams that are not archived: id, name, type (Transactional, Broadcasts, Inbound) and unsubscribe handling. Use a stream's id as message_stream in the other actions. A server has few streams, so they come in one response.
Search outbound messages
postmark-search-outbound-messages
Search sent and queued emails: message id, recipients, from, subject, tag, status, metadata and stream, without bodies (use get-outbound-message). 20 a page. Messages are kept for the server's retention period, 45 days unless changed in Postmark.
Get outbound message
postmark-get-outbound-message
Get one sent email by message id: recipients, from, subject, text and HTML bodies, tag, metadata, status, and its events (Delivered, Bounced, Opened, LinkClicked, Transient, SubscriptionChanged) with their times. A long body can be cut at the response limit.
Search inbound messages
postmark-search-inbound-messages
Search emails the server received: message id, from, to, subject, mailbox hash, attachments' names and sizes, and status. 20 a page. Postmark returns processed messages unless status is given.
Get inbound message
postmark-get-inbound-message
Get one received email by message id: from, to, cc, reply-to, subject, date, text and HTML bodies, headers, attachments' names, status and, if it was blocked, why. A long body can be cut at the response limit.
List bounces
postmark-list-bounces
List bounces: bounce id, type (HardBounce, SoftBounce, Transient and others), the address, the message id, when, and whether Postmark deactivated the address and it can be reactivated (Inactive, CanActivate). 20 a page.
Get bounce
postmark-get-bounce
Get one bounce by id: type, description, details, the address, the message id, when, whether the address is inactive and can be reactivated, and the bounce content. Long content can be cut at the response limit.
Get delivery stats
postmark-get-delivery-stats
Get the server's bounce totals by type, and how many addresses are inactive because of a bounce or a complaint. Changes nothing.
Get outbound stats
postmark-get-outbound-stats
Get the server's sending totals: sent, bounced, bounce rate, spam complaints, opens, unique opens and clicks, for all time or a date range, optionally for one tag or stream. Dates are US Eastern time.
List suppressions
postmark-list-suppressions
List the addresses a stream will not send to, with the reason (HardBounce, SpamComplaint, ManualSuppression), the origin (Recipient, Customer, Admin) and when. Postmark returns every match in one response, so give an address or a date range on a large list: a response over the limit is cut.
List templates
postmark-list-templates
List the server's templates: id, name, alias, whether it is active, and its type (Standard or Layout). 20 a page. Use an id or alias in get-template or send-template-email.
Get template
postmark-get-template
Get one template by id or alias: name, subject, HTML and text bodies with their placeholders, whether it is active, and its layout. Read it before send-template-email to know which values template_model needs.
How do users connect? Each one brings their own Postmark.
- 1.Call for the userYour server invokes the action for the signed-in user. Without a Postmark connection, the SDK throws EndUserNotConnectedError with a connect link.
- 2.The user pastes a keyThe link opens a form that shows where in Postmark's settings to create the key. The link lasts 10 minutes and works once.
- 3.Anlyon checks itThe key is checked with Postmark before it is kept, and bound to api.postmarkapp.com. It is never shown back.
- 4.Your server confirmsYour server confirms the connection for the user who is signed in, and the call goes through.
Guardrails. Suggested limits and approvals, for you to review.
Suggested limits
- 200 emails sent a day
- 200 template emails sent a day
- 10 bounced addresses reactivated a day
- 50 addresses suppressed a day
- 10 suppressions removed a day
Suggested approvals
- A person approves sending an email
- A person approves sending a template email
- A person approves reactivating a bounced address
- A person approves removing a suppression
What the key must allow
- A Server API token
- It reaches that one server and its message streams
Good to know
- Use a server set aside for what your agent sends.
- Reactivating a hard bounce can hurt the server's reputation, so it can wait for a person.
For your own account
- 1.In Postmark, open the server your agent should send from, then its API Tokens tab.
- 2.Copy the Server API token.
- 3.In Anlyon, open Actions, then Integrations, choose Postmark and paste the token.
- 4.Anlyon checks the token with Postmark before storing it. It becomes a secret named POSTMARK, bound to api.postmarkapp.com.
Postmark in your code. For one of your users, or for your own account.
Act for one of your users from your server, or connect your company's own Postmark with the CLI.
import { Client, EndUserNotConnectedError } from "@anlyonhq/sdk";const anlyon = new Client({ apiKey: process.env.ANLYON_API_KEY! });try { const { data } = await anlyon .forUser(session.userId) .actions.invoke("postmark-send-email", { from: "hello@acme.com", to: "sam@example.com", subject: "Your refund is on its way", message_stream: "outbound" }); return { status: "done", grade: data.grade };} catch (error) { if (error instanceof EndUserNotConnectedError) { // The user connects their own Postmark, then you call again. return { status: "connect_required", url: error.connectUrl }; } throw error;}Other integrations. Under the same limits, approvals and receipts.
Available
Stripe
Payments · API key
Refunds under a money ceiling, and every customer, payment and invoice to read.
Available
GitHub
Code · API key
Issues, pull requests and code, in the repositories you choose.
Available
HubSpot
CRM · Sign in
Contacts, companies and deals: search them and change them.
- Anlyon app
- Available
- Your own app
- Recommended for production
