Quote DEFAULT_FROM_EMAIL display name so contact mail sends (#29)
Unit Tests / test (push) Successful in 12s

## Summary
- Closes #28
- Quote `DEFAULT_FROM_EMAIL` display name (`"AI ML Operations, LLC" <info@aimloperations.com>`) so RFC 5322 From parsing succeeds
- Update settings default, email send fallbacks, and `.env` examples

## Problem
Contact form saved leads but notification email to `ryan@aimloperations.com` failed with:
```
Invalid address; only AI ML Operations could be parsed from "AI ML Operations, LLC <info@aimloperations.com>"
```
Comma in unquoted display name treated as address-list separator.

## Test plan
- [ ] Submit contact form in an environment with SMTP configured
- [ ] Confirm lead appears on leads page
- [ ] Confirm email arrives at ryan@aimloperations.com
- [ ] If prod sets `DEFAULT_FROM_EMAIL` in `.env`, ensure that value is also quoted before deployReviewed-on: #29
This commit was merged in pull request #29.
This commit is contained in:
2026-08-07 08:17:31 -07:00
parent 03bb01664f
commit 85369914c8
6 changed files with 8 additions and 7 deletions
+2 -2
View File
@@ -33,10 +33,10 @@ EMAIL_HOST_USER=
EMAIL_HOST_PASSWORD= EMAIL_HOST_PASSWORD=
EMAIL_PORT=2525 EMAIL_PORT=2525
EMAIL_USE_TLS=true EMAIL_USE_TLS=true
# DEFAULT_FROM_EMAIL=AI ML Operations, LLC <info@aimloperations.com> # Display name has a comma — must be quoted (RFC 5322)
# DEFAULT_FROM_EMAIL="AI ML Operations, LLC" <info@aimloperations.com>
# Absolute origin for email logo / footer links # Absolute origin for email logo / footer links
PUBLIC_SITE_URL=https://aimloperations.com PUBLIC_SITE_URL=https://aimloperations.com
# DEFAULT_FROM_EMAIL=AI ML Operations, LLC <info@aimloperations.com>
# Stripe (test keys from https://dashboard.stripe.com/test/apikeys) # Stripe (test keys from https://dashboard.stripe.com/test/apikeys)
STRIPE_SECRET_KEY= STRIPE_SECRET_KEY=
+2 -1
View File
@@ -34,7 +34,8 @@ EMAIL_HOST_USER=replace-with-smtp-user
EMAIL_HOST_PASSWORD=replace-with-smtp-password EMAIL_HOST_PASSWORD=replace-with-smtp-password
EMAIL_PORT=2525 EMAIL_PORT=2525
EMAIL_USE_TLS=true EMAIL_USE_TLS=true
# DEFAULT_FROM_EMAIL=AI ML Operations, LLC <info@aimloperations.com> # Display name has a comma — must be quoted (RFC 5322)
# DEFAULT_FROM_EMAIL="AI ML Operations, LLC" <info@aimloperations.com>
PUBLIC_SITE_URL=https://aimloperations.com PUBLIC_SITE_URL=https://aimloperations.com
# Stripe (live keys from https://dashboard.stripe.com/apikeys) # Stripe (live keys from https://dashboard.stripe.com/apikeys)
+1 -1
View File
@@ -202,7 +202,7 @@ EMAIL_PORT = int(env("EMAIL_PORT", "2525"))
EMAIL_USE_TLS = env_bool("EMAIL_USE_TLS", True) EMAIL_USE_TLS = env_bool("EMAIL_USE_TLS", True)
DEFAULT_FROM_EMAIL = env( DEFAULT_FROM_EMAIL = env(
"DEFAULT_FROM_EMAIL", "DEFAULT_FROM_EMAIL",
"AI ML Operations, LLC <info@aimloperations.com>", '"AI ML Operations, LLC" <info@aimloperations.com>',
) )
# Absolute site origin for email logo / footer links (no trailing slash). # Absolute site origin for email logo / footer links (no trailing slash).
PUBLIC_SITE_URL = env("PUBLIC_SITE_URL", "https://aimloperations.com").rstrip("/") PUBLIC_SITE_URL = env("PUBLIC_SITE_URL", "https://aimloperations.com").rstrip("/")
+1 -1
View File
@@ -282,7 +282,7 @@ def send_pay_link_email(
from_email = getattr( from_email = getattr(
settings, settings,
"DEFAULT_FROM_EMAIL", "DEFAULT_FROM_EMAIL",
"AI ML Operations, LLC <info@aimloperations.com>", '"AI ML Operations, LLC" <info@aimloperations.com>',
) )
from public.email_branding import email_brand_context from public.email_branding import email_brand_context
+1 -1
View File
@@ -41,7 +41,7 @@ def send_emails(modeladmin, request, queryset):
from_email = getattr( from_email = getattr(
settings, settings,
"DEFAULT_FROM_EMAIL", "DEFAULT_FROM_EMAIL",
"AI ML Operations, LLC <info@aimloperations.com>", '"AI ML Operations, LLC" <info@aimloperations.com>',
) )
d = email_brand_context(title=email.subject, content=email.body) d = email_brand_context(title=email.subject, content=email.body)
+1 -1
View File
@@ -25,7 +25,7 @@ def send_contact_email(email, subject, message):
from_email = getattr( from_email = getattr(
settings, settings,
"DEFAULT_FROM_EMAIL", "DEFAULT_FROM_EMAIL",
"AI ML Operations, LLC <info@aimloperations.com>", '"AI ML Operations, LLC" <info@aimloperations.com>',
) )
to = "ryan@aimloperations.com" to = "ryan@aimloperations.com"
d = email_brand_context(subject=subject, message=message, email=email) d = email_brand_context(subject=subject, message=message, email=email)