Gmail notification on jersey-public submission #431
Labels
No labels
domain:backend
domain:devops
domain:frontend
status:approved
status:in-progress
status:needs-fix
status:qa
type:bug
type:devops
type:feature
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
forgejo_admin/basketball-api#431
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
Feature
Lineage
Depends on
basketball-api#430(POST endpoint). Part of System B production rollout. Architecture inarch-jersey-intake.Repo
forgejo_admin/basketball-apiUser Story
As Marcus
I want an email notification when a public jersey order lands
So that I know to review it promptly instead of polling the admin UI
Context
Per
feedback_gmail_oauth_not_smtp.mdandfeedback_email_architecture.md, basketball-api already has a gmail-sdk integration for sending email fromwestsidebasketball@gmail.com. This ticket adds a FastAPIBackgroundTasksthat fires on every successful POST.Notifications go only to
westsidebasketball@gmail.com. Do NOT cc Lucas, do NOT send to the submitter's email (no reply-to automation in this ticket).File Targets
Files to modify:
src/basketball_api/routes/jersey_public.py— addBackgroundTasksdep, enqueue the email-send after successful insertsrc/basketball_api/services/jersey_public_email.py(or matching existing email service location) — new helper that formats the email and calls the existing gmail senderFiles the agent should NOT touch:
westside-emailsrepo — this notification is inline plain text, not MJMLEmail content
Subject:
New jersey order: <player_name> — <tier>Body (plain text):
The
submitter_keycloak_subline lets Marcus cross-reference in Keycloak Admin Console if there's any identity question.Acceptance Criteria
BackgroundTasks— POST response is not blocked by SMTPTest Expectations
pytest tests/ -k jersey_public_emailConstraints
feedback_gmail_oauth_not_smtp.md)BackgroundTasks— never block POSTChecklist
basketball-apimainRelated
westside-basketball— projectstory:WS-S31— admin public jersey intake linkarch-jersey-intake— architecture docbasketball-api#430(POST endpoint)feedback_gmail_oauth_not_smtp.md— email architecture guidanceScope Review: APPROVED
Review note:
review-949-2026-04-10Scope is tight and well-constrained. All traceability legs verified (story:WS-S31 exists on project-westside-basketball, arch-jersey-intake note exists, depends-on #430 is open). Existing
gmail_sdk.GmailClientintegration confirmed atsrc/basketball_api/services/email.pywithget_gmail_client(tenant, db)— reuse path is concrete.BackgroundTaskspattern already in use atroutes/players.py:260for reference.File targets
routes/jersey_public.pyandservices/jersey_public_email.pydon't exist yet — correct: T3 (#430) creates the route, T4 modifies it. Do NOT dispatch until #430 merges.No decomposition needed (2 files, 5 AC, ~5 min agent work).
Notes for dev agent:
services/email.py::get_gmail_clientpattern, don't instantiateGmailClientdirectlyservices.jersey_public_emailmodule boundary, not thegmail_sdklibrarylogger.exception()inside the BackgroundTasks callable so tracebacks reach logs without propagating to the handler