Email template deployment is fragmented — need single source of truth with CI #12
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Type
Bug
Lineage
Discovered during jersey reminder email work (2026-04-04 through 2026-04-08). Multiple rounds of broken emails caused by fragmented template system — HTML template, plain text body, and deployment path all diverged.
Repo
forgejo_admin/westside-emailsandforgejo_admin/basketball-apiWhat Broke
The email template system has three independent sources of content that must be manually kept in sync:
westside-emails/src/— the canonical template~/westside-email-templates/compiled/) AND baked into the Docker image (COPY --from=email-compiler) — two copies that can divergebasketball_api/services/email.py— completely separate from the template, manually maintainedThis caused: stale "three options" and "March 30 deadline" in plain text while HTML was correct, wrong jersey images, opt-out showing after removal — each fix only addressed one layer, missing the others.
Repro Steps
Expected Behavior
Single source of truth:
_html_to_plain_text()function in email.py — not hardcodedFix Required
1. Add Woodpecker CI to westside-emails — on merge to main: compile all MJML templates, push compiled HTML to a known location (Harbor artifact, MinIO, or git subtree that basketball-api pulls)
2. Remove hostPath mount — basketball-api should get templates from one source: either baked into the Docker image (via the email-compiler build stage) or pulled from MinIO/artifact store at startup
3. Use
_html_to_plain_text()for jersey-reminder —send_jersey_reminder_emailin email.py should call_html_to_plain_text(html_body)instead of maintaining a separate hardcoded plain text body. Other email functions already do this (see line 1193).4. Remove hardcoded plain text body from
send_jersey_reminder_email— once auto-generation is in placeEnvironment
COPY --from=email-compilerbakes templates at build time~/westside-email-templates/compiled/overlays the baked templatesAcceptance Criteria
send_jersey_reminder_emailuses_html_to_plain_text()instead of hardcoded plain textRelated
project-westside-basketballstory:WS-S22— parent email communicationsforgejo_admin/westside-emails#10— division-aware images (exposed this problem)westside-emails/.woodpecker.yaml(to create),basketball-api/Dockerfile(email-compiler stage),basketball-api/services/email.py:1283(hardcoded plain text)