Email digest unsubscribe links fall back to localhost:3000 when API_URL is unset
Labels / Complexity: bug · Trivial — Trivial
Summary
EmailDigestService.sendDigestForUser (src/email-digest/email-digest.service.ts) builds each digest's unsubscribe URL from this.configService.get<string>('API_URL', 'http://localhost:3000/api'). In any environment where API_URL is not configured, every digest email carries an unsubscribe link pointing at localhost:3000 — a dead link for recipients and a broken unsubscribe flow. This is a second instance of the defect class already fixed for the main email path (#1054, email.service.ts), here in the digest's own URL builder.
Proposal
Acceptance criteria
- Digest unsubscribe links never contain
localhost unless explicitly configured for local development.
- The unsubscribe link in a sent digest reaches a working endpoint.
Getting started
Commands: npm test.
Good first files to read: src/email-digest/email-digest.service.ts, src/email/email.service.ts.
Email digest unsubscribe links fall back to localhost:3000 when API_URL is unset
Labels / Complexity: bug · Trivial — Trivial
Summary
EmailDigestService.sendDigestForUser(src/email-digest/email-digest.service.ts) builds each digest's unsubscribe URL fromthis.configService.get<string>('API_URL', 'http://localhost:3000/api'). In any environment whereAPI_URLis not configured, every digest email carries an unsubscribe link pointing atlocalhost:3000— a dead link for recipients and a broken unsubscribe flow. This is a second instance of the defect class already fixed for the main email path (#1054,email.service.ts), here in the digest's own URL builder.Proposal
localhostfallback: fail configuration (or log loudly) whenAPI_URLis unset, matching the fix pattern from Email unsubscribe links fall back to localhost:3000 when FRONTEND_URL is unset #1054.Acceptance criteria
localhostunless explicitly configured for local development.Getting started
src/email-digest/email-digest.service.ts— theAPI_URLfallback linesrc/email/email.service.ts— the same defect already fixed in Email unsubscribe links fall back to localhost:3000 when FRONTEND_URL is unset #1054Commands:
npm test.Good first files to read:
src/email-digest/email-digest.service.ts,src/email/email.service.ts.