style: restructure email formats with 收件账户 and app_name for verification

This commit is contained in:
2026-07-11 22:11:15 +08:00
parent e56bdef0f7
commit cf0f7d3956
2 changed files with 10 additions and 5 deletions

View File

@@ -105,19 +105,22 @@ def _format_promotion(data: dict, account_email: str = "") -> str:
lines = [
f"📢 *推广*",
f"━━━━━━━━━━━━━━━━━━",
f"*收件账户:* {_escape(account_email)}",
"",
f"{_escape(summary)}",
f"账户: {_escape(account_email)}",
]
return "\n".join(lines)
def _format_verification(data: dict, account_email: str = "") -> str:
code = data.get("verification_code", "")
app = data.get("app_name", "")
lines = [
f"🔑 *验证码*",
f"━━━━━━━━━━━━━━━━━━",
f"`{_escape(code)}`",
f"账户: {_escape(account_email)}",
f"*收件账户:* {_escape(account_email)}",
f"*应用:* {_escape(app)}",
f"*验证码:* `{_escape(code)}`",
]
return "\n".join(lines)
@@ -126,9 +129,9 @@ def _format_normal(data: dict, account_email: str = "") -> str:
lines = [
f"📧 *{_escape(data.get('subject', '邮件摘要'))}*",
f"━━━━━━━━━━━━━━━━━━",
f"*收件账户:* {_escape(account_email)}",
f"*收件人:* {_escape(data.get('recipient', '未知'))}",
f"*发件人:* {_escape(data.get('sender', '未知'))}",
f"*账户:* {_escape(account_email)}",
"",
_escape(data.get("summary", "")),
]