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.

1

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é.

2

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_.

3

(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:

  1. Resend dashboard → DomainsAdd Domain
  2. Enter your domain → Resend shows DNS records (SPF, DKIM, DMARC) to add at your registrar
  3. Add them in your DNS panel (Cloudflare, Namecheap, etc.) → wait 5-30 min for verification
  4. Once verified, set RESEND_FROM_EMAIL on Railway to YourCafe <orders@yourcafe.com>
4

(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/email

In 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.com
  • INBOUND_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.

5

Paste into Railway

Open your StockPilot service on Railway Variables tab → + New Variable:

  • RESEND_API_KEY=paste the key from step 2
  • DEFAULT_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.

6

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.

From this point forward, every PO and morning brief goes through Resend.
← Back to Settings