Follow-on to password-reset / outbound email work (#1, PR #27).
We now persist OutboundEmail rows (queued → sending → sent/failed) in Django admin, and set custom header X-Hesychia-Email-Id on each message for correlation.
SMTP2GO supports webhooks for email lifecycle events (docs): processed, delivered, bounce (hard/soft), open, click, spam, reject, etc.
Goal
Update OutboundEmail status (and an event history) from SMTP2GO webhooks so admin shows real delivery outcome, not only “accepted by SMTP”.
Scope
POST /api/.../webhooks/smtp2go/ (or similar) endpoint — auth via shared secret / Authorization header
Match messages via X-Hesychia-Email-Id custom header (and/or SMTP2GO email_id stored after send if available)
Configure webhook in SMTP2GO app/API for prod + beta (setup)
Admin: show provider events + last provider status on OutboundEmail
Tests with sample SMTP2GO payloads
Notes
Free SMTP2GO plans: 1 webhook; paid: up to 10
Prefer JSON output format
Do not expose PII beyond what we already store on OutboundEmail
## Summary
Follow-on to password-reset / outbound email work ([#1](https://git.aimloperations.com/ai_ml_operations/chat_backend/issues/1), PR #27).
We now persist `OutboundEmail` rows (queued → sending → sent/failed) in Django admin, and set custom header `X-Hesychia-Email-Id` on each message for correlation.
SMTP2GO supports webhooks for email lifecycle events ([docs](https://developers.smtp2go.com/docs/webhooks-overview)): **processed**, **delivered**, **bounce** (hard/soft), **open**, **click**, **spam**, **reject**, etc.
## Goal
Update `OutboundEmail` status (and an event history) from SMTP2GO webhooks so admin shows real delivery outcome, not only “accepted by SMTP”.
## Scope
- [ ] `POST /api/.../webhooks/smtp2go/` (or similar) endpoint — auth via shared secret / Authorization header
- [ ] Map webhook `event` → status / child `OutboundEmailEvent` rows (delivered, bounced, opened, …)
- [ ] Match messages via `X-Hesychia-Email-Id` custom header (and/or SMTP2GO `email_id` stored after send if available)
- [ ] Configure webhook in SMTP2GO app/API for prod + beta ([setup](https://developers.smtp2go.com/docs/setup-a-webhook))
- [ ] Admin: show provider events + last provider status on `OutboundEmail`
- [ ] Tests with sample SMTP2GO payloads
## Notes
- Free SMTP2GO plans: 1 webhook; paid: up to 10
- Prefer JSON output format
- Do not expose PII beyond what we already store on `OutboundEmail`
westfarn
self-assigned this 2026-07-27 04:41:23 -07:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
Follow-on to password-reset / outbound email work (#1, PR #27).
We now persist
OutboundEmailrows (queued → sending → sent/failed) in Django admin, and set custom headerX-Hesychia-Email-Idon each message for correlation.SMTP2GO supports webhooks for email lifecycle events (docs): processed, delivered, bounce (hard/soft), open, click, spam, reject, etc.
Goal
Update
OutboundEmailstatus (and an event history) from SMTP2GO webhooks so admin shows real delivery outcome, not only “accepted by SMTP”.Scope
POST /api/.../webhooks/smtp2go/(or similar) endpoint — auth via shared secret / Authorization headerevent→ status / childOutboundEmailEventrows (delivered, bounced, opened, …)X-Hesychia-Email-Idcustom header (and/or SMTP2GOemail_idstored after send if available)OutboundEmailNotes
OutboundEmail