Skip to content

Email and winnings

The worker sends winner notifications and a personalized recap after a game is final. HTML and plain-text versions carry the same core information.

Messages and recipients

MessageRecipientContents
Winner notificationWinning player with an address and notify=truePeriod(s) won, scores, and player details
Halfway / end-of-season summarySUMMARY_EMAIL_TO, falling back to EMAIL_TOPlayers with winnings, halftime/final win counts, and earned prizes
Weekly summarySUMMARY_EMAIL_TO, falling back to EMAIL_TOGame recap, selected player’s squares, season results, and winnings

A player who wins both halftime and final receives one combined winner message. The recap is personalized to SUMMARY_PLAYER_ID; it is not sent separately to every player. The summary’s personalization also supplies the browser’s default player ID through the public snapshot.

Reporting week

The reporting week is the NFL week of the newly completed game. The timer begins checking at kickoff + three hours and waits for final status, including games ending after midnight. There is no Monday cutoff in the active scheduler.

The recap includes the opponent, game date, selected player’s squares in team–opponent order, halftime/final scores, winning digits, and winners. Cached final results through that reporting week follow, including the current game. Future and unfinished games are omitted from the summary history.

Templates support a BYE presentation, but the scheduler processes configured non-BYE games and sends no scheduled BYE postgame email. The website does include a BYE week in its schedule and featured-week logic.

Prize calculation

flowchart LR
    Results[Verified final game results] --> Half[Count player's halftime wins]
    Results --> Final[Count player's final wins]
    Half --> HAmount[Multiply by HALFTIME_PAYOUT]
    Final --> FAmount[Multiply by FINAL_PAYOUT]
    HAmount --> Total[Add using decimal arithmetic]
    FAmount --> Total
    Total --> Display[Display earned-prize total]

Each verified halftime win contributes HALFTIME_PAYOUT; each verified final win contributes FINAL_PAYOUT. Both default to $50.00 throughout the season. Winning both periods earns $100.00. With no wins, the total is $0.00.

Other players’ wins, future games, and unavailable results do not contribute. Totals come from verified game results, not email sends, so another email does not increase earnings. These values represent earned prizes, not confirmation of payment. Decimal arithmetic preserves cents; see configuration for allowed payout values.

Templates and delivery guarantees

Templates live in app/templates/. Shared presentation is in app/templates/styles/email.css; its rules are embedded in a <style> block. Keep presentation rules in that shared stylesheet rather than inline style attributes; the rendering tests enforce this convention. Jinja escapes dynamic HTML and fails when required variables are missing. Clients that strip style blocks may show a simpler version, and plain text is provided alongside HTML.

The deploy ZIP includes .html, .txt, and .css assets under app/. Omitting those files breaks report rendering even if Python imports succeed.

ACS submission uses a 120-second wait for a successful response. A successful submission is not proof that a recipient read the email. Each delivery is claimed in private state before submission. Ambiguous sending claims require operator review; see email recovery.

Implementation references

Season summaries

The halfway email covers the first half of configured games, rounded up (nine of 17 games); the wrap-up covers all configured games. BYE weeks do not count. Each waits for verified final results for every game in its reporting period, including postponed games. Players sort by earned dollars descending, with alphabetical ties. Players with no earned prize money are omitted from both HTML and plain text. These use the summary recipient, not a mailing to the whole roster.

Milestones use the same durable delivery claims as weekly messages. The hourly worker checks pending milestones even when all games are marked completed, within the existing season processing window. Installing this change midseason can send an eligible milestone that has not previously been recorded.

HTML emails share the site’s dark surfaces, purple and gold accents, and red-and-gold branding, with system fonts and compact tables for email clients. The winner email features a large money bag emoji and a “You won!” heading. Colors are explicitly dark rather than selected by system appearance settings; email clients may still override colors. See local email previews for sample HTML and plain-text messages.