feat(email): log when an email is queued for delivery #309

Merged
nrupard merged 1 commit from feat/BUNYIP-309-log-email-queued into main 2026-07-01 16:51:01 +02:00
Owner

All bunyip emails funnel through EmailService::send_email (crates/bunyip-domain/src/services/email.rs), which logged only Email sent successfully after the transport returned. A send that failed left no record that a delivery had even been attempted, and there was no "queued" signal at all (emails are sent synchronously; there is no separate queue).

This adds an Email queued for delivery info log at the transport handoff, right before transport.send(email), carrying the same to + subject fields as the existing sent line. It brackets every send so an attempt is always visible in the logs even when the send errors, and it covers every email kind (welcome, verify, password reset, magic link, email-change, payment-failed, ...) because they all route through send_email. No new PII: the recipient address is already logged at INFO in the sent line. Dev-mode (no transport) keeps its existing Email not sent (dev mode) line.

Verified: just check-container green (fmt + clippy + workspace lib tests, no warnings).

Closes BUNYIP-309.

All bunyip emails funnel through `EmailService::send_email` (`crates/bunyip-domain/src/services/email.rs`), which logged only `Email sent successfully` after the transport returned. A send that failed left no record that a delivery had even been attempted, and there was no "queued" signal at all (emails are sent synchronously; there is no separate queue). This adds an `Email queued for delivery` info log at the transport handoff, right before `transport.send(email)`, carrying the same `to` + `subject` fields as the existing sent line. It brackets every send so an attempt is always visible in the logs even when the send errors, and it covers every email kind (welcome, verify, password reset, magic link, email-change, payment-failed, ...) because they all route through `send_email`. No new PII: the recipient address is already logged at INFO in the sent line. Dev-mode (no transport) keeps its existing `Email not sent (dev mode)` line. Verified: `just check-container` green (fmt + clippy + workspace lib tests, no warnings). Closes BUNYIP-309.
feat(email): log when an email is queued for delivery
All checks were successful
E2E / Playwright against deployment (pull_request) Successful in 23s
Check / fmt + clippy + build + tests (pull_request) Successful in 16m57s
Create release / Create release from merged PR (pull_request) Has been skipped
899e102d4e
BUNYIP-309: send_email only logged "Email sent successfully" after the transport returned, so a send that failed left no record that a delivery was attempted. Add an "Email queued for delivery" info log at the transport handoff (to + subject, matching the existing fields) that brackets every send, so an attempt is visible even when the send errors. Covers every email kind since they all funnel through send_email.

#BUNYIP-309

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
nrupard scheduled this pull request to auto merge when all checks succeed 2026-07-01 16:36:38 +02:00
nrupard deleted branch feat/BUNYIP-309-log-email-queued 2026-07-01 16:51:02 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
psa-systems/bunyip!309
No description provided.