saasprokit
Email

Local Development

Catch mail with MailDev from this repo's Compose file

This repo already defines MailDev. Do not docker run, npx maildev, or add a service to Compose.

docker compose up -d postgres maildev

Then open http://localhost:1080. SMTP is localhost:1025.

pnpm --filter email dev (port 3003) only previews templates. It does not send, and MailDev will not show those previews.

Env

Leave EMAIL_PROVIDER unset. Nodemailer defaults to localhost:1025 (packages/email/keys.ts). Auto-detect is Resend vs Nodemailer, not “MailDev vs production”.

Trigger a real send

Sign up at /auth/sign-up (or request a password reset). Auth hooks in packages/auth/server.ts send the mail. sendWelcomeEmail is not wired.

The Playwright helper is apps/web/e2e/helpers/maildev.ts:

await clearInbox();
const mail = await waitForEmail(email, { subjectContains: "verif" });

Spec that uses it: apps/web/e2e/auth/sign-up.spec.ts.

REST (MailDev v2)

Same paths the e2e helper uses — /api/email, not /email:

curl http://localhost:1080/api/email
curl -X DELETE http://localhost:1080/api/email/all

The Compose web service does not override SMTP_HOST. From the host, localhost:1025 is correct. Inside another container on the Compose network, the hostname would be maildev.

On this page