Docs · Setup
Send email via Resend in 3 minutes
One-time setup in Resend's dashboard. After this every outbound email — purchase orders to suppliers and morning briefs — goes through Resend with proper SPF/DKIM/DMARC so it lands in the inbox, not spam.
Open Resend's dashboard
Go to resend.com/api-keys. Sign up if you don't have an account — Resend is free for the first 3,000 emails/month, plenty for a small café.
Create an API key
Click Create API Key. Use these values:
- Name:
StockPilot - Permission: Sending access (NOT Full access — sending-only is the safe default)
- Domain: leave as “All domains” for now
Click Create. Copy the key — it's only shown once. Starts with re_.
(Optional) Verify a sending domain
By default Resend sends from onboarding@resend.dev — fine for testing, looks unprofessional in production. To send from orders@yourcafe.com:
- Resend dashboard → Domains → Add Domain
- Enter your domain → Resend shows DNS records (SPF, DKIM, DMARC) to add at your registrar
- Add them in your DNS panel (Cloudflare, Namecheap, etc.) → wait 5-30 min for verification
- Once verified, set
RESEND_FROM_EMAILon Railway toYourCafe <orders@yourcafe.com>
(Optional) Wire inbound replies
For supplier reply auto-classification (so when a supplier emails back “ETA Tuesday” the bot picks it up and updates the PO), Resend forwards inbound messages to:
Inbound webhook URL
https://stockpilot-app-production-2a53.up.railway.app/api/inbound/emailIn Resend → Domains → your domain → Inbound → enable inbound parsing → paste the URL above. Set REPLY_DOMAIN on Railway to your inbound domain so outbound POs include Reply-To: reply+<poId>@<domain>. Also set INBOUND_EMAIL_SECRET to a long random value, then configure the inbound provider to send it as Authorization: Bearer ... or X-Inbound-Secret.
REPLY_DOMAIN=reply.yourdomain.comINBOUND_EMAIL_SECRET=a long random shared secret
Skip this step on day 1. The app falls back to no inbound parsing — supplier replies just land in your normal inbox until you wire this.
Paste into Railway
Open your StockPilot service on Railway → Variables tab → + New Variable:
RESEND_API_KEY=paste the key from step 2DEFAULT_EMAIL_PROVIDER=resend
Without flipping DEFAULT_EMAIL_PROVIDER=resend, the app stays in console-log mode (fine for dev, useless in prod). Railway redeploys automatically — takes ~60 seconds.
Send a test from Settings
Reload /settings. Email row shows resend auto-send. Click Send test email→ check your inbox. Should land in <10 seconds.