Claude Code direct mail: let your agent wire up postcards
Claude Code direct mail takes one skill file: drop Mailr's SKILL.md into .claude/skills, ask Claude Code to mail a postcard when something happens in your app, and it writes the request, the trigger and the test against a free key.
What to mail from Claude Code
| When this happens | Mail this |
|---|---|
| A new customer signs up | A founder welcome letter three days later. (Welcome letter) |
| A Stripe payment fails twice | A calm billing letter after the emails didn't work. (Failed payment) |
| An order is delivered | A review request card a week later. (Review request) |
Set it up
- Get the kit. Download https://mailr.dev/downloads/mailr-kit.zip and copy skills/mailr-direct-mail into your repo's .claude/skills/ folder. It has the API, every size and clear zone, and every template.
- Add your test key. Create a test key in the dashboard (Developers) and put it in .env as MAILR_API_KEY. Test pieces are free and never print.
- Ask for the feature. Tell Claude Code what should trigger mail and what it should say. The skill tells it to build against the test key, add an Idempotency-Key, and save the piece id on the record.
- Watch it run, then go live. The test piece walks through every status in about 8 minutes. Add funds, swap in the live key, and the same code prints and mails.
What to tell Claude Code
Use the mailr-direct-mail skill. When a customer's first order ships (our orders table, status = 'shipped'),
send them the tmpl_thank_you 6x9 postcard with first_name and a 15% promo_code.
Read MAILR_API_KEY from .env, send an Idempotency-Key of "thank-you-<order_id>",
store the returned postcard id on the order, and add a test that uses the test key.- Claude Code loads skills from .claude/skills in the project (or ~/.claude/skills for every project).
- Keep MAILR_API_KEY out of the repo; the skill tells the agent to read it from the environment.
What it costs
Each live piece is paid from your Mailr balance, printing and postage included: a 4x6 postcard is $0.85, a 6x9 $0.89 and an 8.5x11 letter $0.95 on pay as you go, less on a plan. Test pieces are free. All prices.
Templates that fit: Welcome letter (8.5x11), Failed payment (8.5x11), Review request (4x6).
Questions
Does Mailr have an MCP server?
Not yet. Claude Code works through the REST API, guided by the skill file in the template kit and https://mailr.dev/llms.txt.
Can Claude Code design the postcard too?
Yes. The skill gives it the page size with bleed, the safe area and the address block for every size, so it can write front and back HTML that passes the pre-print check.
What does a test cost?
Nothing. Test keys never print or charge. Live postcards start at $0.85 with postage.