Quote DEFAULT_FROM_EMAIL display name so contact mail sends (#29)
Unit Tests / test (push) Successful in 12s
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:
+2
-2
@@ -33,10 +33,10 @@ EMAIL_HOST_USER=
|
||||
EMAIL_HOST_PASSWORD=
|
||||
EMAIL_PORT=2525
|
||||
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
|
||||
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_SECRET_KEY=
|
||||
|
||||
+2
-1
@@ -34,7 +34,8 @@ EMAIL_HOST_USER=replace-with-smtp-user
|
||||
EMAIL_HOST_PASSWORD=replace-with-smtp-password
|
||||
EMAIL_PORT=2525
|
||||
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
|
||||
|
||||
# Stripe (live keys from https://dashboard.stripe.com/apikeys)
|
||||
|
||||
@@ -202,7 +202,7 @@ EMAIL_PORT = int(env("EMAIL_PORT", "2525"))
|
||||
EMAIL_USE_TLS = env_bool("EMAIL_USE_TLS", True)
|
||||
DEFAULT_FROM_EMAIL = env(
|
||||
"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).
|
||||
PUBLIC_SITE_URL = env("PUBLIC_SITE_URL", "https://aimloperations.com").rstrip("/")
|
||||
|
||||
@@ -282,7 +282,7 @@ def send_pay_link_email(
|
||||
from_email = getattr(
|
||||
settings,
|
||||
"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
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ def send_emails(modeladmin, request, queryset):
|
||||
from_email = getattr(
|
||||
settings,
|
||||
"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)
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ def send_contact_email(email, subject, message):
|
||||
from_email = getattr(
|
||||
settings,
|
||||
"DEFAULT_FROM_EMAIL",
|
||||
"AI ML Operations, LLC <info@aimloperations.com>",
|
||||
'"AI ML Operations, LLC" <info@aimloperations.com>',
|
||||
)
|
||||
to = "ryan@aimloperations.com"
|
||||
d = email_brand_context(subject=subject, message=message, email=email)
|
||||
|
||||
Reference in New Issue
Block a user