diff --git a/app/modules/core/routes/api/admin_settings.py b/app/modules/core/routes/api/admin_settings.py index 0d7beb2e..0a57e799 100644 --- a/app/modules/core/routes/api/admin_settings.py +++ b/app/modules/core/routes/api/admin_settings.py @@ -656,10 +656,16 @@ def send_test_email( """ Send a test email using the platform email configuration. - This tests the email provider configuration from environment variables. + Reports the *effective* config — DB overrides if any, else .env. The + test email's body must match what actually got used to send it, + otherwise admins can't trust the page they're testing from. """ from app.modules.messaging.services.email_service import EmailService + effective = get_effective_email_config(db) + eff_provider = effective.get("provider", app_settings.email_provider) + eff_from = effective.get("from_email", app_settings.email_from_address) + try: email_service = EmailService(db) @@ -676,13 +682,13 @@ def send_test_email(
If you received this email, your email settings are working correctly!
- Provider: {app_settings.email_provider}
- From: {app_settings.email_from_address}
+ Provider: {eff_provider}
+ From: {eff_from}