-
2.31.0
Stablereleased this
2026-09-06 21:39:52 +02:00 | 87 commits to main since this releaseExpand {{ standings }} token in admin emails to a styled table
What
Adds a
<!-- STANDINGS -->token to the admin custom-email composer. When present in the Markdown body, it expands to the current standings as an inline-styled HTML table that mirrors the/standingspage — gray header, zebra rows, maroon names — styled inline so it survives email clients (no external CSS, no<style>block).No UI change to the compose page beyond one new row in the Markdown cheat sheet documenting the token.
How
app/standings_email.py(new):standings_markdown(session)builds a Markdown pipe table from active players (same query/sort as/standings);style_email_table(html)injects inline styles into markdown-it's table output.app/mailer.py:custom_email_bodydoes the token substitution — it renders the standings fragment in isolation and styles it before the outer email template wraps everything in layout tables, so the styler never touches the presentation tables.send_custom_emailforwards the pre-built markdown.- Preview (
v2.py) and background send (send_admin_email.py) each build the standings lazily — only when a message uses the token — so a token-free batch never depends on a current week existing (which would raise between seasons).
Testing
tests/test_mailer.py: token present → styled<table>/<th>; token absent → body unchanged.- flake8 clean, pylint 10.00/10.
- Note: the 7
test_admin_email_routes.pyfailures are pre-existing onmain, unrelated to this change.
resolves #233
Issues closed
- #233 Create a form page for sending out the standings
- #178 Have body of standings email be 'proper' HTML body of real standings
Pull request: #483
Downloads
-
Source code (ZIP)
0 downloads
-
Source code (TAR.GZ)
0 downloads