Files
orion/app
Samir Boulahtit f2d1bdcd49
Some checks failed
CI / ruff (push) Successful in 17s
CI / validate (push) Has been cancelled
CI / dependency-scanning (push) Has been cancelled
CI / docs (push) Has been cancelled
CI / deploy (push) Has been cancelled
CI / pytest (push) Has been cancelled
fix(messaging): test email + EmailLog show effective config, not stale env
Two display bugs where admin-facing email diagnostics reported the
.env-level config even when database overrides were in effect — so a
prod admin who switched from SendGrid (.env) to SMTP via /admin/settings
would receive a test email whose body still said "Provider: sendgrid"
and "From: noreply@wizard.lu", even though the actual From header used
the DB-overridden address. Confusing, and erodes trust in the page that
exists specifically to verify the setup.

- admin_settings.send_test_email: read get_effective_email_config(db)
  and display its provider + from_email in the test email's body. Also
  use the effective provider when stamping the audit-log row.
- email_service: in the "template not found" EmailLog branch, record
  the effective from_email / from_name / provider from
  self._platform_config (already populated correctly by __init__),
  instead of falling back to the env-only settings.email_*.

Verified by importing both modules; pure plumbing fix, no schema or
behavior change for callers.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-10 21:30:41 +02:00
..