From f36803cf91fc8f85b9f0e716f82eb8ac4609b4ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B5=85=E5=BF=B5?= Date: Wed, 21 Oct 2026 10:23:54 +0800 Subject: [PATCH] =?UTF-8?q?feat(email):=20notify=5Femails=20=E7=A9=BA?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E5=9B=9E=E9=80=80=E7=A7=9F=E6=88=B7=20brand.?= =?UTF-8?q?email=EF=BC=88=E7=AB=99=E7=82=B9=E9=82=AE=E7=AE=B1=E4=BD=9C?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E9=80=9A=E7=9F=A5=E6=94=B6=E4=BB=B6=E4=BA=BA?= =?UTF-8?q?=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Code --- app/platform/config_views.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/platform/config_views.py b/app/platform/config_views.py index d3c7b97..0284cfd 100644 --- a/app/platform/config_views.py +++ b/app/platform/config_views.py @@ -52,11 +52,18 @@ def resolve_email_settings(config_data: dict | None) -> dict: - smtp 给了 dict → 段内逐键回退(缺键/空串 → 平台设置快照对应键 → env 对应值, 租户可只改密码/只换 host); - sender_name 空 → 平台默认(_DEFAULT_SENDER_NAME); - - notify_emails 空列表 → env NOTIFY_EMAIL 单元素。 + - notify_emails 空列表 → 租户 brand.email 单元素(用户 2026-10-21 要求: + 默认取每个租户配置的站点邮箱) → env NOTIFY_EMAIL 单元素。 """ email = ((config_data or {}).get("email")) or {} smtp = email.get("smtp") or {} notify = [e for e in (email.get("notify_emails") or []) if e] + if not notify: + # 回退 1:租户品牌配置里的 email(站点对外展示邮箱——客户留资通知 + # 默认发到客户自己的联系邮箱,不需要每个租户显式配 notify_emails) + brand_email = ((config_data or {}).get("brand") or {}).get("email") + if brand_email: + notify = [brand_email] return { "host": (smtp.get("host") or settings_store.get("smtp.host")