Log every DM-email decision point (diagnostic follow-up to #66/#68)

A live "no emails arriving" report produced literally nothing in the
logs, not even the SMTP-not-configured line -- this app has no logging
config lowering the root level below Python's own WARNING default, so
every .debug()/.info() call has been silently invisible in production
all along. Bumped the SMTP-not-configured line to .warning, and added
one at each early-return in _maybe_email_dm_notification (no other
participant, recipient online, already has unread messages) plus a
confirmation right before actually sending -- next attempt will show
exactly which branch is being hit instead of nothing at all.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-28 17:56:03 -06:00
co-authored by Claude Sonnet 5
parent 1a05cf5515
commit aeaaef96ec
2 changed files with 33 additions and 1 deletions
+6 -1
View File
@@ -221,7 +221,12 @@ async def send_email(
"""
cfg = await get_smtp_settings(db)
if cfg is None:
logger.debug("SMTP not configured; skipping email to %s", to_address)
# WARNING, not .debug -- this app has no logging config lowering
# the root level below Python's own WARNING default, so anything
# below that is silently invisible in production (confirmed live:
# a real "no emails arriving" report produced nothing in the logs
# at all, this line included, even though it was relevant).
logger.warning("SMTP not configured; skipping email to %s", to_address)
return
palette = await _resolve_palette(db, theme_user)
html_body = _render_html(palette, subject, paragraphs, cta_label, cta_url)