Implement custom logging email backend for development: log outgoing emails to Loguru and stdout

This commit is contained in:
Ross
2025-12-15 13:14:12 +00:00
parent 03b23b9178
commit c071f38920
4 changed files with 17 additions and 3 deletions
+4
View File
@@ -327,6 +327,10 @@ DEFAULT_AUTO_FIELD = "django.db.models.AutoField"
EMAIL_BACKEND = os.environ.get("EMAIL_BACKEND", "django.core.mail.backends.smtp.EmailBackend")
# Path used by Django's file-based email backend. In dev this should be
# mounted into the container at `/var/log/rad/emails` (see `docker-compose.dev.yml`).
EMAIL_FILE_PATH = os.environ.get("EMAIL_FILE_PATH", os.path.join(BASE_DIR, "../logs/emails"))
# SENDGRID_API_KEY = os.getenv('SENDGRID_API_KEY')
SENDGRID_API_KEY = (
"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"