Relock: record the >= pin form
af499d25
A Sigil library for the Postmark email API. Send transactional and broadcast email, query bounces, and parse delivery / bounce / complaint / open / click webhooks — all with a single server-token header, no request signing.
Designed to drop in as a replacement for sigil-ses when you'd rather not fight AWS sandbox approval.
(import (postmark api))
(define client
(postmark-client server-token: (getenv "POSTMARK_SERVER_TOKEN")))
;; Single send
(let ((result (postmark-send client
"newsletter@example.com"
"reader@example.com"
"Hello from Sigil"
text: "Plain-text body."
html: "<h1>Hello</h1><p>HTML body.</p>"
tag: "newsletter"
reply-to: "reply@example.com")))
(display (postmark-email-result-message-id result)))
;; Send to multiple recipients
(postmark-send client
"newsletter@example.com"
'("a@example.com" "b@example.com")
"Issue #42"
text: "Content…"
bcc: "log@example.com")
;; Batch send — hand-build each payload
(postmark-send-batch client
(list
(build-send-payload "from@example.com" "a@example.com"
"Subject A" text: "Body A")
(build-send-payload "from@example.com" "b@example.com"
"Subject B" text: "Body B")))
;; Query bounces
(postmark-list-bounces client count: 100 type: "HardBounce")
;; Reactivate a bounced address
(postmark-activate-bounce client 12345)Configure a Postmark webhook to POST to your HTTP handler, then:
(import (postmark webhook))
(let ((ev (postmark-parse-webhook json-body)))
(when ev
(cond
((postmark-hard-bounce-event? ev)
;; deactivate the address
(remove-subscriber (postmark-webhook-event-recipient ev)))
((postmark-spam-complaint-event? ev)
(unsubscribe (postmark-webhook-event-recipient ev)))
((postmark-delivery-event? ev)
(log-delivered (postmark-webhook-event-message-id ev))))))postmark-webhook-event carries:
type — 'bounce, 'spam-complaint, 'delivery, 'open, 'clickmessage-id — Postmark message IDrecipient — affected addressdetails — event-specific dict (bounce type code, user agent, click target, …)raw — the original parsed dict, for any field not exposed aboveConsumers typically read a single variable:
POSTMARK_SERVER_TOKEN — per-server API token from the Postmark console.The bundled examples/live-send.sgl script also honours:
POSTMARK_FROM — verified sender (default david@systemcrafters.net)POSTMARK_TO — recipient for the integration testsigil-stdlib ^0.13.0sigil-http ^0.13.0sigil-json ^0.13.0(No sigil-crypto — Postmark does not sign requests.)
sigil deps install
sigil build
sigil testBSD-3-Clause
$ git clone https://codeberg.org/sigil/sigil-postmark
v0.1.1 — latest by version, released 2 Sep 2026
All releases — 2 tags in this repository.
One page per file, and every line has a permalink.
Relock: record the >= pin form
af499d25
798b1007
7152898a
The last 20 commits keep a page here. Everything older lives in the clone.