Skip to content

hono-email/postmark provides PostmarkAdapter for the Postmark Email API.

import { Body, Html, Text, sendEmail } from 'hono-email'
import { PostmarkAdapter } from 'hono-email/postmark'
const receipt = await sendEmail({
adapter: PostmarkAdapter({
serverToken: process.env.POSTMARK_SERVER_TOKEN!,
messageStream: 'outbound',
}),
from: 'sender@example.com',
to: 'recipient@example.com',
subject: 'Welcome',
jsx: (
<Html>
<Body>
<Text>Hello from Postmark.</Text>
</Body>
</Html>
),
})

For the full list of configuration options, see the Postmark Options API Reference.

Like all provider adapters, Postmark supports to, cc, bcc, replyTo, custom headers, and attachments. Inline attachments use cid when the provider supports content IDs.

Type: string

Your Postmark server token.

Type: string · Default: 'outbound'

Postmark message stream ID.

Type: string

Tag for grouping and filtering messages in the Postmark dashboard.

Type: boolean

Enable open tracking.

Type: 'HtmlAndText' | 'HtmlOnly' | 'TextOnly' | 'None'

Enable link click tracking.

Type: string

Override the Postmark API base URL.

Type: (input: string, init: RequestInit) => Promise<Response>

Custom fetch implementation. Defaults to globalThis.fetch.

Type: string

limits.maxAttachmentSize Optional

Section titled “limits.maxAttachmentSize ”

Type: number

Maximum attachment size in bytes.