Complete contract reminder email: merge branding fix, validate, blast #275

Open
opened 2026-03-31 16:34:21 +00:00 by forgejo_admin · 0 comments

Type

Feature

Lineage

Continuation of forgejo_admin/basketball-api #270. Branch 270-contract-reminder-email has working code that never deployed cleanly due to CI failures (#274). This ticket completes the work once CI is green.

Repo

forgejo_admin/basketball-api

User Story

As Marcus,
I want to send contract reminder emails to all unsigned parents,
So that rosters are finalized by April 2nd.

Context

The contract reminder endpoint was built in #270 and merged to main (image 23902fe). However the Kings/Queens branding fix (dynamic accent color + program name) was added after the merge and lives only on branch 270-contract-reminder-email. The deployed image has hardcoded pink with no team-based branding.

Additionally the email-templates ConfigMap was manually patched during debugging and now has a reverted template (no {{program_name}} / {{accent_color}} placeholders). It needs to be restored to the branched version.

Prerequisite: CI fix #274 must be merged first so the pipeline auto-deploys.

Branding logic (already written, on branch):

  • Team name contains "Queens" → "WESTSIDE QUEENS", #e91e8c (pink)
  • Team name contains "Kings" → "WESTSIDE KINGS", #dc2626 (red)
  • Mixed → "WESTSIDE KINGS & QUEENS", #dc2626

State of current ConfigMap template (needs restoring to use placeholders):

  • Header border: hardcoded #e91e8c → needs {{accent_color}}
  • Header text: hardcoded "WESTSIDE KINGS & QUEENS" → needs {{program_name}}
  • Deadline strong tag: hardcoded #e91e8c → needs {{accent_color}}

Note on branch commits: The branch 270-contract-reminder-email includes two commits ahead of main:

  1. f8138d2 — the original contract reminder endpoint (already in main via squash, may show as ahead due to history divergence — read the diff, don't re-apply)
  2. c8f0f1a — adds .distinct() to prevent duplicate players in multi-team scenario (NOT in main, must be included)

Use git diff main origin/270-contract-reminder-email to see exactly what ships. Do not cherry-pick blindly.

File Targets

  • src/basketball_api/services/email.py — branding fix already on branch. Diff includes _program_branding(), updated _build_player_section(accent_color), updated send_contract_reminder_email() that passes program_name + accent_color to template. Also includes .distinct() fix.
  • src/basketball_api/routes/admin.py.distinct() fix on branch, must be included
  • data/email-templates/contract-reminder.html — restore {{program_name}} and {{accent_color}} placeholders (branch version is correct)
  • tests/test_contract_reminder.py — may have additions on branch; verify against main diff
  • overlays/basketball-api/prod/kustomization.yaml in forgejo_admin/pal-e-deployments (second repo) — update image tag after new image builds from this PR

Do NOT touch: jersey routes, checkout routes, any other email functions.

PR Strategy

This work spans two repos:

  1. forgejo_admin/basketball-api — open PR from 270-contract-reminder-email into main. CI builds new image.
  2. forgejo_admin/pal-e-deployments — open a second PR updating the basketball-api image tag in overlays/basketball-api/prod/kustomization.yaml to the new digest once CI passes.

Both PRs must merge for the deployment to go live.

Acceptance Criteria

  • CI pipeline passes (requires #274 merged first)
  • POST /admin/email/contract-reminder?test_email=draneylucas@gmail.com sends branded email: red "WESTSIDE KINGS" header for Kings player
  • POST /admin/email/contract-reminder?test_email=marcusdraney23@gmail.com sends branded email: pink "WESTSIDE QUEENS" header for Queens player (Marcus has "Test Queens Player" on 17U Elite Queens)
  • Lucas and Marcus both approve the test emails
  • POST /admin/email/contract-reminder (no param) sends to all 36 unsigned rostered parents

Test Expectations

  • Existing 11 tests in tests/test_contract_reminder.py still pass
  • Run: pytest tests/test_contract_reminder.py -v
  • Manual validation: check inbox for correct branding before blasting

Constraints

  • Do not touch the ConfigMap directly — the template lives in data/email-templates/contract-reminder.html in the repo. The deployment-patch or a separate kustomize configmap generator should pick it up. (Check how jersey-reminder.html gets into the ConfigMap — match that pattern exactly.)
  • tofu plan -lock=false not applicable here
  • Branch 270-contract-reminder-email has all the right code — read it before writing anything new
  • Use git diff main origin/270-contract-reminder-email as ground truth for what needs to ship

Checklist

  • PR opened (basketball-api)
  • Tests pass
  • CI green + new image built
  • PR opened (pal-e-deployments image tag)
  • Test emails approved by Lucas and Marcus
  • Blast sent
  • westside-basketball — project this affects
  • forgejo_admin/basketball-api #270 — original contract reminder issue
  • forgejo_admin/basketball-api #274 — CI fix (must merge first)
### Type Feature ### Lineage Continuation of `forgejo_admin/basketball-api #270`. Branch `270-contract-reminder-email` has working code that never deployed cleanly due to CI failures (#274). This ticket completes the work once CI is green. ### Repo `forgejo_admin/basketball-api` ### User Story As Marcus, I want to send contract reminder emails to all unsigned parents, So that rosters are finalized by April 2nd. ### Context The contract reminder endpoint was built in #270 and merged to main (image `23902fe`). However the Kings/Queens branding fix (dynamic accent color + program name) was added after the merge and lives only on branch `270-contract-reminder-email`. The deployed image has hardcoded pink with no team-based branding. Additionally the email-templates ConfigMap was manually patched during debugging and now has a reverted template (no `{{program_name}}` / `{{accent_color}}` placeholders). It needs to be restored to the branched version. **Prerequisite:** CI fix #274 must be merged first so the pipeline auto-deploys. **Branding logic (already written, on branch):** - Team name contains "Queens" → "WESTSIDE QUEENS", `#e91e8c` (pink) - Team name contains "Kings" → "WESTSIDE KINGS", `#dc2626` (red) - Mixed → "WESTSIDE KINGS & QUEENS", `#dc2626` **State of current ConfigMap template** (needs restoring to use placeholders): - Header border: hardcoded `#e91e8c` → needs `{{accent_color}}` - Header text: hardcoded "WESTSIDE KINGS & QUEENS" → needs `{{program_name}}` - Deadline strong tag: hardcoded `#e91e8c` → needs `{{accent_color}}` **Note on branch commits:** The branch `270-contract-reminder-email` includes two commits ahead of main: 1. `f8138d2` — the original contract reminder endpoint (already in main via squash, may show as ahead due to history divergence — read the diff, don't re-apply) 2. `c8f0f1a` — adds `.distinct()` to prevent duplicate players in multi-team scenario (NOT in main, must be included) Use `git diff main origin/270-contract-reminder-email` to see exactly what ships. Do not cherry-pick blindly. ### File Targets - `src/basketball_api/services/email.py` — branding fix already on branch. Diff includes `_program_branding()`, updated `_build_player_section(accent_color)`, updated `send_contract_reminder_email()` that passes `program_name` + `accent_color` to template. Also includes `.distinct()` fix. - `src/basketball_api/routes/admin.py` — `.distinct()` fix on branch, must be included - `data/email-templates/contract-reminder.html` — restore `{{program_name}}` and `{{accent_color}}` placeholders (branch version is correct) - `tests/test_contract_reminder.py` — may have additions on branch; verify against main diff - `overlays/basketball-api/prod/kustomization.yaml` in **`forgejo_admin/pal-e-deployments`** (second repo) — update image tag after new image builds from this PR Do NOT touch: jersey routes, checkout routes, any other email functions. ### PR Strategy This work spans two repos: 1. **`forgejo_admin/basketball-api`** — open PR from `270-contract-reminder-email` into `main`. CI builds new image. 2. **`forgejo_admin/pal-e-deployments`** — open a second PR updating the `basketball-api` image tag in `overlays/basketball-api/prod/kustomization.yaml` to the new digest once CI passes. Both PRs must merge for the deployment to go live. ### Acceptance Criteria - [ ] CI pipeline passes (requires #274 merged first) - [ ] `POST /admin/email/contract-reminder?test_email=draneylucas@gmail.com` sends branded email: red "WESTSIDE KINGS" header for Kings player - [ ] `POST /admin/email/contract-reminder?test_email=marcusdraney23@gmail.com` sends branded email: pink "WESTSIDE QUEENS" header for Queens player (Marcus has "Test Queens Player" on 17U Elite Queens) - [ ] Lucas and Marcus both approve the test emails - [ ] `POST /admin/email/contract-reminder` (no param) sends to all 36 unsigned rostered parents ### Test Expectations - [ ] Existing 11 tests in `tests/test_contract_reminder.py` still pass - [ ] Run: `pytest tests/test_contract_reminder.py -v` - [ ] Manual validation: check inbox for correct branding before blasting ### Constraints - Do not touch the ConfigMap directly — the template lives in `data/email-templates/contract-reminder.html` in the repo. The deployment-patch or a separate kustomize configmap generator should pick it up. (Check how jersey-reminder.html gets into the ConfigMap — match that pattern exactly.) - `tofu plan -lock=false` not applicable here - Branch `270-contract-reminder-email` has all the right code — read it before writing anything new - Use `git diff main origin/270-contract-reminder-email` as ground truth for what needs to ship ### Checklist - [ ] PR opened (basketball-api) - [ ] Tests pass - [ ] CI green + new image built - [ ] PR opened (pal-e-deployments image tag) - [ ] Test emails approved by Lucas and Marcus - [ ] Blast sent ### Related - `westside-basketball` — project this affects - `forgejo_admin/basketball-api #270` — original contract reminder issue - `forgejo_admin/basketball-api #274` — CI fix (must merge first)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
forgejo_admin/basketball-api#275
No description provided.