email: split digest renderer to digest_email.py
email_service.py was 428 lines covering three different concerns: SMTP transport, OTP/welcome rendering (tightly coupled — same brand template + theme), and digest rendering (a totally different shape of email, different layout, different copy cadence). The two halves changed at different cadences and made the file noisy to navigate. Extracted render_digest_email + _DIGEST_HTML_TEMPLATE + _strip_html_to_text to app/services/digest_email.py. SMTP transport and the OTP/welcome surface stay in email_service.py. Import sites updated: email_digest_job and test_email_render now import render_digest_email from digest_email. The OTP/welcome import sites (auth router, branding tests, test_email_service) are untouched. No behaviour change — pure relocation. Templates byte-identical. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
parent
4adc8dfe82
commit
b055eea1c2
4 changed files with 119 additions and 107 deletions
|
|
@ -1,7 +1,7 @@
|
|||
"""Unit tests for render_digest_email."""
|
||||
from __future__ import annotations
|
||||
|
||||
from app.services.email_service import render_digest_email
|
||||
from app.services.digest_email import render_digest_email
|
||||
|
||||
|
||||
def test_daily_subject_and_bodies():
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue