{"_id":"@absolutejs/dispatch-postmark","_rev":"4-8ef5289bae9bbc509cf1af4327568a3e","name":"@absolutejs/dispatch-postmark","dist-tags":{"latest":"0.1.0"},"versions":{"0.0.1":{"name":"@absolutejs/dispatch-postmark","version":"0.0.1","keywords":["dispatch","email","postmark","absolutejs","transactional"],"author":"Alex Kahn","license":"Apache-2.0","_id":"@absolutejs/dispatch-postmark@0.0.1","maintainers":[{"name":"alexkahndev","email":"alexkahn2019@gmail.com"}],"dist":{"shasum":"c6bebbd8da2f0eefa69edecc8515ff07d5a1cfaa","tarball":"https://registry.npmjs.org/@absolutejs/dispatch-postmark/-/dispatch-postmark-0.0.1.tgz","fileCount":6,"integrity":"sha512-krx472YKnrqLewECa+rhAWP7QKVyVxBY4IvUWMojx4qrkG2ls/b8p+0U7Bxwc0MdXIAl299IJCeyfPdqXEWg0w==","signatures":[{"sig":"MEQCIB+SHS8FxRuYA6IHIsKlN7va+75rvouXGdvnok/DOc9jAiAwnLRYZbfT514sE4HIlUDEPTCOvOsro9mS/koFRdYy8A==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":18894},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","shasum":"c6bebbd8da2f0eefa69edecc8515ff07d5a1cfaa","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"}},"scripts":{"test":"bun test","build":"rm -rf dist && bun build src/index.ts --outdir dist --sourcemap --target=bun --external @absolutejs/dispatch --external postmark && tsc --project tsconfig.build.json","format":"prettier --write \"./**/*.{ts,json,md}\"","release":"bun run format && bun run build && bun publish","typecheck":"tsc --noEmit"},"_npmUser":{"name":"alexkahndev","email":"alexkahn2019@gmail.com"},"_integrity":"sha512-krx472YKnrqLewECa+rhAWP7QKVyVxBY4IvUWMojx4qrkG2ls/b8p+0U7Bxwc0MdXIAl299IJCeyfPdqXEWg0w==","repository":{"url":"https://github.com/absolutejs/dispatch-adapters.git","type":"git","directory":"postmark"},"_npmVersion":"10.8.3","description":"Postmark-backed EmailAdapter for @absolutejs/dispatch. Maps EmailMessage to Postmark's sendEmail params; surfaces the MessageID as DispatchResult.id.","directories":{},"_nodeVersion":"24.3.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"postmark":"^4.0.0","prettier":"3.5.3","@types/bun":"1.3.14","typescript":"5.8.3","@absolutejs/dispatch":"^0.0.1"},"peerDependencies":{"postmark":">= 4.0.0","@absolutejs/dispatch":">= 0.0.1"},"_npmOperationalInternal":{"tmp":"tmp/dispatch-postmark_0.0.1_1780174515401_0.5287975769096678","host":"s3://npm-registry-packages-npm-production"}},"0.0.2":{"name":"@absolutejs/dispatch-postmark","version":"0.0.2","keywords":["dispatch","email","postmark","absolutejs","transactional"],"author":"Alex Kahn","license":"Apache-2.0","_id":"@absolutejs/dispatch-postmark@0.0.2","maintainers":[{"name":"alexkahndev","email":"alexkahn2019@gmail.com"}],"homepage":"https://github.com/absolutejs/dispatch-adapters/tree/main/postmark","bugs":{"url":"https://github.com/absolutejs/dispatch-adapters/issues"},"dist":{"shasum":"24f33b37b37adce31fa436cf34d4e7e5b068a238","tarball":"https://registry.npmjs.org/@absolutejs/dispatch-postmark/-/dispatch-postmark-0.0.2.tgz","fileCount":11,"integrity":"sha512-E17GzGGAVk5yPmzFqtv5P53w5JwogIEgyzyO+G6v7aVq50VoJnjLeCzMBIilrrH7WmBzOH9n5/lm2d0W0/5tnQ==","signatures":[{"sig":"MEUCIQDsto0w3RfjVKWTrdnsFEoemWVP9ggCt1bPAEdHNLssVwIgWTke2KdD/TDiale3VJjzFqixvbDi1OG3KSfxPRHAZ6U=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1114364},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","shasum":"24f33b37b37adce31fa436cf34d4e7e5b068a238","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"},"./manifest":{"types":"./dist/manifest.d.ts","import":"./dist/manifest.js","default":"./dist/manifest.js"},"./manifest.json":"./dist/manifest.json"},"scripts":{"test":"bun test","build":"rm -rf dist && bun build src/index.ts src/manifest.ts --outdir dist --sourcemap --target=bun --external @absolutejs/dispatch --external postmark && tsc --project tsconfig.build.json && absolute-manifest emit","format":"prettier --write \"./**/*.{ts,json,md}\"","release":"bun run format && bun run build && bun publish","typecheck":"tsc --noEmit"},"_npmUser":{"name":"alexkahndev","email":"alexkahn2019@gmail.com"},"_integrity":"sha512-E17GzGGAVk5yPmzFqtv5P53w5JwogIEgyzyO+G6v7aVq50VoJnjLeCzMBIilrrH7WmBzOH9n5/lm2d0W0/5tnQ==","absolutejs":{"manifestContract":1},"repository":{"url":"https://github.com/absolutejs/dispatch-adapters.git","type":"git","directory":"postmark"},"_npmVersion":"10.8.3","description":"Postmark-backed EmailAdapter for @absolutejs/dispatch. Maps EmailMessage to Postmark's sendEmail params; surfaces the MessageID as DispatchResult.id.","directories":{},"_nodeVersion":"24.3.0","dependencies":{"@sinclair/typebox":"^0.34.0","@absolutejs/manifest":"^0.1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"postmark":"^4.0.0","prettier":"3.5.3","@types/bun":"1.3.14","typescript":"5.8.3","@absolutejs/dispatch":"^0.0.1"},"peerDependencies":{"postmark":">= 4.0.0","@absolutejs/dispatch":">= 0.0.1"},"_npmOperationalInternal":{"tmp":"tmp/dispatch-postmark_0.0.2_1783964727163_0.852873197405349","host":"s3://npm-registry-packages-npm-production"}},"0.0.3":{"name":"@absolutejs/dispatch-postmark","version":"0.0.3","keywords":["dispatch","email","postmark","absolutejs","transactional"],"author":{"name":"Alex Kahn"},"license":"Apache-2.0","_id":"@absolutejs/dispatch-postmark@0.0.3","maintainers":[{"name":"alexkahndev","email":"alexkahn2019@gmail.com"}],"homepage":"https://github.com/absolutejs/dispatch-adapters/tree/main/postmark","bugs":{"url":"https://github.com/absolutejs/dispatch-adapters/issues"},"dist":{"shasum":"0e7fb6e14088d9185c63a7684f2e45dfc4e41d2a","tarball":"https://registry.npmjs.org/@absolutejs/dispatch-postmark/-/dispatch-postmark-0.0.3.tgz","fileCount":11,"integrity":"sha512-EeBeJaoB5vP3Y7chQhP3ldiXgBUQAe/CEr2oPbK0lN+6XFO1py0Fj5RQaR76ASOxyrBMDRJnVh8ykcXnCczXJA==","signatures":[{"sig":"MEUCIQC+W/++D3skwqFgGj3YUHBFdjRbV8Y5xqQQTOilyOK5MgIgXTT6QUYFO1jTZ8K7SV62Oz6iJjg3WKYR38pkdkJqhwY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":29188},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"},"./manifest":{"types":"./dist/manifest.d.ts","import":"./dist/manifest.js","default":"./dist/manifest.js"},"./manifest.json":"./dist/manifest.json"},"gitHead":"748a80e3deb2d01bae7ac76c787c5a3d00899ea8","scripts":{"test":"bun test","build":"rm -rf dist && bun build src/index.ts src/manifest.ts --outdir dist --sourcemap --target=bun --external @absolutejs/dispatch --external '@absolutejs/dispatch/*' --external @absolutejs/manifest --external @sinclair/typebox --external postmark --external 'postmark/*' && tsc --project tsconfig.build.json && absolute-manifest emit","format":"prettier --write \"./**/*.{ts,json,md}\"","release":"bun run check:package && npm publish --access public","typecheck":"tsc --noEmit","check:package":"bun run format && bun run typecheck && bun run test && bun run verify-package && bun run build && bun run verify-package --artifacts","verify-package":"absolute-manifest verify-package"},"_npmUser":{"name":"alexkahndev","email":"alexkahn2019@gmail.com"},"absolutejs":{"runtimePeers":{"postmark":{"range":">=4.0.0 <6","tested":"5.1.0","optional":false,"buildExternals":["postmark","postmark/*"],"artifactImports":[]},"@absolutejs/dispatch":{"range":">=0.1.1 <0.2","tested":"0.1.1","optional":false,"buildExternals":["@absolutejs/dispatch","@absolutejs/dispatch/*"],"artifactImports":[]}},"manifestContract":2},"repository":{"url":"git+https://github.com/absolutejs/dispatch-adapters.git","type":"git","directory":"postmark"},"_npmVersion":"10.9.2","description":"Postmark-backed EmailAdapter for @absolutejs/dispatch. Maps EmailMessage to Postmark's sendEmail params; surfaces the MessageID as DispatchResult.id.","directories":{},"_nodeVersion":"22.14.0","dependencies":{"@sinclair/typebox":"^0.34.0","@absolutejs/manifest":"0.7.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"postmark":"5.1.0","prettier":"3.5.3","@types/bun":"1.3.14","typescript":"5.8.3","@absolutejs/dispatch":"0.1.1"},"peerDependencies":{"postmark":">=4.0.0 <6","@absolutejs/dispatch":">=0.1.1 <0.2"},"_npmOperationalInternal":{"tmp":"tmp/dispatch-postmark_0.0.3_1784964462438_0.8138972602079602","host":"s3://npm-registry-packages-npm-production"}},"0.1.0":{"name":"@absolutejs/dispatch-postmark","version":"0.1.0","description":"Postmark-backed EmailAdapter for @absolutejs/dispatch. Maps EmailMessage to Postmark's sendEmail params; surfaces the MessageID as DispatchResult.id.","repository":{"type":"git","url":"git+https://github.com/absolutejs/dispatch-adapters.git","directory":"postmark"},"homepage":"https://github.com/absolutejs/dispatch-adapters/tree/main/postmark","bugs":{"url":"https://github.com/absolutejs/dispatch-adapters/issues"},"main":"./dist/index.js","module":"./dist/index.js","types":"./dist/index.d.ts","type":"module","license":"Apache-2.0","author":{"name":"Alex Kahn"},"publishConfig":{"access":"public"},"keywords":["dispatch","email","postmark","absolutejs","transactional"],"scripts":{"build":"rm -rf dist && bun build src/index.ts src/manifest.ts --outdir dist --sourcemap --target=bun --external @absolutejs/dispatch --external '@absolutejs/dispatch/*' --external @absolutejs/manifest --external @sinclair/typebox --external postmark --external 'postmark/*' && tsc --project tsconfig.build.json && absolute-manifest emit","test":"bun test","typecheck":"tsc --noEmit","format":"prettier --write \"./**/*.{ts,json,md}\"","verify-package":"absolute-manifest verify-package","check:package":"bun run format && bun run typecheck && bun run test && bun run verify-package && bun run build && bun run verify-package --artifacts","release":"bun run check:package && npm publish --access public"},"peerDependencies":{"@absolutejs/dispatch":">=0.7.0 <0.8","postmark":">=4.0.0 <6"},"devDependencies":{"@absolutejs/dispatch":"0.7.1","@types/bun":"1.3.14","postmark":"5.1.0","prettier":"3.5.3","typescript":"5.8.3"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"},"./manifest":{"types":"./dist/manifest.d.ts","import":"./dist/manifest.js","default":"./dist/manifest.js"},"./manifest.json":"./dist/manifest.json"},"absolutejs":{"manifestContract":2,"runtimePeers":{"@absolutejs/dispatch":{"artifactImports":[],"buildExternals":["@absolutejs/dispatch","@absolutejs/dispatch/*"],"optional":false,"range":">=0.7.0 <0.8","tested":"0.7.1"},"postmark":{"artifactImports":[],"buildExternals":["postmark","postmark/*"],"optional":false,"range":">=4.0.0 <6","tested":"5.1.0"}}},"dependencies":{"@absolutejs/manifest":"0.7.2","@sinclair/typebox":"^0.34.0"},"_id":"@absolutejs/dispatch-postmark@0.1.0","gitHead":"c7ced4f2c36deff0db92b72ef5bf86ca98aa004d","_nodeVersion":"22.14.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-qMxdGVlrRrZKRNg/LSHtLpgbtyiJo/3XFkr5vpBqsmKu+8mNaZlAlA2WeBnYuD7KEBxkSzVI3guu7I9iEBe5Ag==","shasum":"a876e832f578b782ff4c207010d59204e8216b79","tarball":"https://registry.npmjs.org/@absolutejs/dispatch-postmark/-/dispatch-postmark-0.1.0.tgz","fileCount":12,"unpackedSize":39440,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIDuzNfl4uTcqF+HJvwlqWCXly1CN2lh9if4XqfZQdlM4AiEA0cQvNKTEi+hwshyeygXXI0d2RPcb9TIkUDSwzDabIE8="}]},"_npmUser":{"name":"alexkahndev","email":"alexkahn2019@gmail.com"},"directories":{},"maintainers":[{"name":"alexkahndev","email":"alexkahn2019@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/dispatch-postmark_0.1.0_1785618461082_0.8182065533349006"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-30T20:55:15.304Z","modified":"2026-08-01T21:07:41.433Z","0.0.1":"2026-05-30T20:55:15.549Z","0.0.2":"2026-07-13T17:45:27.339Z","0.0.3":"2026-07-25T07:27:42.576Z","0.1.0":"2026-08-01T21:07:41.240Z"},"bugs":{"url":"https://github.com/absolutejs/dispatch-adapters/issues"},"author":{"name":"Alex Kahn"},"license":"Apache-2.0","homepage":"https://github.com/absolutejs/dispatch-adapters/tree/main/postmark","keywords":["dispatch","email","postmark","absolutejs","transactional"],"repository":{"type":"git","url":"git+https://github.com/absolutejs/dispatch-adapters.git","directory":"postmark"},"description":"Postmark-backed EmailAdapter for @absolutejs/dispatch. Maps EmailMessage to Postmark's sendEmail params; surfaces the MessageID as DispatchResult.id.","maintainers":[{"name":"alexkahndev","email":"alexkahn2019@gmail.com"}],"readme":"# @absolutejs/dispatch-postmark\n\nPostmark-backed `EmailAdapter` for\n[@absolutejs/dispatch](https://github.com/absolutejs/dispatch).\n\n**Docs:** [absolutejs.com/documentation/dispatch-overview#postmark](https://absolutejs.com/documentation/dispatch-overview#postmark)\n\n## Install\n\n```sh\nbun add @absolutejs/dispatch @absolutejs/dispatch-postmark postmark\n```\n\n## Usage\n\n```ts\nimport { ServerClient } from \"postmark\";\nimport { createDispatcher } from \"@absolutejs/dispatch\";\nimport { createPostmarkAdapter } from \"@absolutejs/dispatch-postmark\";\n\nconst postmark = new ServerClient(process.env.POSTMARK_SERVER_TOKEN!);\n\nconst dispatcher = createDispatcher({\n  email: createPostmarkAdapter({\n    client: postmark,\n    defaultFrom: \"no-reply@acme.io\",\n    // Optional — defaults to Postmark's transactional stream.\n    // messageStream: 'broadcast',\n  }),\n});\n\nawait dispatcher.email({\n  to: \"alice@example.com\",\n  subject: \"Welcome to Acme\",\n  text: \"Click here to verify: ...\",\n  // metadata.tag → Postmark Tag (single-string analytics segment);\n  // other string entries → Postmark Metadata (string→string map):\n  metadata: { tag: \"onboarding\", campaign: \"welcome-v2\" },\n});\n```\n\n## API\n\n```ts\ncreatePostmarkAdapter({\n  client,             // Required — your `new ServerClient(serverToken)`\n  defaultFrom?,       // Required if your messages don't set `from`\n  messageStream?,     // Default: Postmark's transactional stream\n  mapMetadata?,       // Customize EmailMessage.metadata → Postmark Tag/Metadata\n})\n```\n\n### `mapMetadata`\n\nBy default the adapter:\n\n- Extracts `metadata.tag` (string) into Postmark's `Tag` field\n  (a single-string analytics segment per message)\n- Maps every OTHER **string-valued** entry into Postmark's `Metadata`\n  (a string→string map)\n- Filters out non-string values (Postmark Metadata values must be\n  strings)\n\nOverride to customize:\n\n```ts\ncreatePostmarkAdapter({\n  client: postmark,\n  mapMetadata: (metadata) => ({\n    Tag: typeof metadata.flow === \"string\" ? metadata.flow : \"transactional\",\n    Metadata: { tenant: String(metadata.tenant ?? \"unknown\") },\n  }),\n});\n```\n\n## Error mapping\n\nPostmark's response shape:\n\n```ts\n{\n  MessageID, SubmittedAt, To, ErrorCode, Message;\n}\n```\n\n- `ErrorCode !== 0` (and not undefined) → adapter throws with\n  `Postmark ErrorCode <n>: <Message>`. `@absolutejs/dispatch`'s error\n  path records the exception on the `dispatch.email.send` span, bumps\n  the failed counter, and emits `dispatch.email.failed`.\n- `ErrorCode === 0` (or undefined) → treated as success.\n  `DispatchResult.id` = `response.MessageID`.\n\n## License\n\n[Apache 2.0](../LICENSE). Tier B substrate-adjacent — rides\n`@absolutejs/dispatch` (BSL Tier A) and `postmark` (MIT).\n","readmeFilename":"README.md"}