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

This commit is contained in:
earthjasonlin committed 2026-07-11 22:11:15 +08:00
1 parent e56bdef0f7
commit cf0f7d3956
2 files changed
+10 -5

No files matched your search

+7 -4
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", "")),
]
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.