Auto registration email with token link after Stripe payment #35
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#35
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?
Lineage
plan-2026-03-08-tryout-prep→ Phase 3b → auto-email on paymentRepo
forgejo_admin/basketball-apiUser Story
As a parent who just paid via Stripe
I want to receive an email with a link to complete my child's registration profile
So that I can fill out player info and sign the waiver before tryout day
Context
The Stripe webhook (
process_checkout_completed) already creates parent/player/registration records and callssend_confirmation_email(). But the current email is a generic "payment received" confirmation with old blue/gold branding. It does NOT include a registration token link.Need to:
registration_tokenfor the parent after Stripe payment (inprocess_checkout_completed){base_url}/register?token={token})#d42026,#0a0a0a) — import frombrand.pydraneylucas@gmail.com(tenantgmail_accountalready set todraneylucas)The email subject should be something like: "Complete [Player Name]'s Tryout Registration — Westside Kings & Queens"
File Targets
Files to modify:
src/basketball_api/services/registration.py— after creating parent record, generateregistration_token(usesecrets.token_urlsafe(32)) and save to parentsrc/basketball_api/services/email.py— updatesend_confirmation_email()to include registration token link + Westside red/black branding. Useconfig.base_urlfor the link. Import brand colors frombrand.py.Files NOT to touch:
src/basketball_api/routes/webhooks.py— webhook handler is finesrc/basketball_api/routes/register.py— registration form already handles?token=xxxsrc/basketball_api/brand.py— use existing colors, don't modifyAcceptance Criteria
process_checkout_completed()generates aregistration_tokenfor the parent if they don't have onesend_confirmation_email()includes a clickable link:{base_url}/register?token={token}#d42026red,#0a0a0ablack,#f0f0f0text)Test Expectations
process_checkout_completedgenerates registration_token for parentsend_confirmation_emailincludes token link in email bodypytest tests/ -vConstraints
from basketball_api.config import settingsforsettings.base_urlsecrets.token_urlsafe(32)for token generation (same as existing pattern)base_urlparam or pull from settingsChecklist
Related
project-westside-basketballsend_confirmation_email()inservices/email.py