Transactional5 min read•Audience: Developers
Using PostBrix with Postmark
Deliver transactional receipts and password resets through Postmark using template model variables.
Key Takeaways
- Postmark templates use Mustache/Handlebars template syntax.
- In Postmark, create a template and paste your PostBrix HTML export into the code editor.
- Pass variables in your Postmark API request using the TemplateModel payload.
- Add Postmark’s unsubscribe tag: {{{pm:unsubscribe}}} for broadcast message streams.
Postmark Template Integration#
Postmark expects variables from the TemplateModel object:
In PostBrix:
code
html
When calling Postmark’s API in Node.js:
code
javascript
Transactional vs Broadcast Message Streams#
Postmark separates sending reputation between two stream types:
- Transactional Streams: For password resets and receipts. Unsubscribe links are not required by law for strictly transactional notifications.
- Broadcast Streams: For newsletters and product updates. You must include Postmark's unsubscribe tag:
{{{pm:unsubscribe}}}.
Frequently Asked Questions
Does Postmark modify the CSS in my PostBrix HTML?
Postmark has an optional "Inline CSS styles" setting. Because PostBrix already provides bulletproof element styles, you can disable Postmark’s inliner to protect mobile media queries.
How do I test Postmark templates without spending credits?
Postmark provides a "Test" API key and sandbox stream that logs delivery payloads without sending real messages.