Add SMTP send flow for approved outreach

This commit is contained in:
Matthias
2026-06-05 21:05:59 +02:00
parent 42a3ea64a5
commit b2f7348ef0
10 changed files with 1531 additions and 56 deletions

View File

@@ -1,9 +1,10 @@
---
id: TASK-14
title: Send approved outreach through Stalwart SMTP
status: To Do
status: In Progress
assignee: []
created_date: '2026-06-03 19:14'
updated_date: '2026-06-05 15:57'
labels:
- mvp
- email
@@ -24,19 +25,24 @@ Implement approved email sending through the self-hosted Stalwart mail server us
## Acceptance Criteria
<!-- AC:BEGIN -->
- [ ] #1 Nodemailer is configured for Stalwart SMTP/SMTPS using environment or Convex secrets
- [ ] #2 E-Mail freigeben und senden sends only the currently approved/editable email draft to the visible recipient
- [ ] #3 A final send action shows recipient, subject, sender, and audit link before sending
- [ ] #4 Convex records sent timestamp, recipient, subject, audit link, SMTP result, and any error details
- [ ] #5 SMTP failures keep the lead in a retryable review state and do not mark the lead as contacted
- [x] #1 Nodemailer is configured for Stalwart SMTP/SMTPS using environment or Convex secrets
- [x] #2 E-Mail freigeben und senden sends only the currently approved/editable email draft to the visible recipient
- [x] #3 A final send action shows recipient, subject, sender, and audit link before sending
- [x] #4 Convex records sent timestamp, recipient, subject, audit link, SMTP result, and any error details
- [x] #5 SMTP failures keep the lead in a retryable review state and do not mark the lead as contacted
<!-- AC:END -->
## Implementation Plan
<!-- SECTION:PLAN:BEGIN -->
1. Add SMTP transport configuration from secrets.
2. Add server-side send function that accepts only approved outreach IDs.
3. Add final confirmation UI with recipient, subject, sender, and audit link.
4. Store SMTP success/error outcomes and update lead/outreach status.
5. Test success and failure paths with safe non-production recipients before real use.
1. Analyse und TDD-Testergänzung
2. Implementierung backend Claims/Record + Guard-Fixes
3. Typing/Actions straffen + package lock
4. Typechecks lokal ausführen
<!-- SECTION:PLAN:END -->
## Implementation Notes
<!-- SECTION:NOTES:BEGIN -->
Implemented TASK-14 via subagent-driven TDD. Verification passed: targeted outreach tests (27/27), pnpm test (278/278), pnpm exec tsc -p tsconfig.json --noEmit, pnpm lint (0 errors, 2 generated BetterAuth warnings), pnpm build (passed with network-enabled run for Google Fonts). Task remains In Progress until explicit user confirmation after manual SMTP testing.
<!-- SECTION:NOTES:END -->