style: beautify email formats with type labels and consistent layout
This commit is contained in:
@@ -103,7 +103,9 @@ def format_summary(data: dict, account_email: str = "") -> str:
|
||||
def _format_promotion(data: dict, account_email: str = "") -> str:
|
||||
summary = data.get("summary", "")
|
||||
lines = [
|
||||
f"📢 {_escape(summary)}",
|
||||
f"📢 *推广*",
|
||||
f"━━━━━━━━━━━━━━━━━━",
|
||||
f"{_escape(summary)}",
|
||||
f"账户: {_escape(account_email)}",
|
||||
]
|
||||
return "\n".join(lines)
|
||||
@@ -112,7 +114,9 @@ def _format_promotion(data: dict, account_email: str = "") -> str:
|
||||
def _format_verification(data: dict, account_email: str = "") -> str:
|
||||
code = data.get("verification_code", "")
|
||||
lines = [
|
||||
f"🔑 {_escape(code)}",
|
||||
f"🔑 *验证码*",
|
||||
f"━━━━━━━━━━━━━━━━━━",
|
||||
f"```{_escape(code)}```",
|
||||
f"账户: {_escape(account_email)}",
|
||||
]
|
||||
return "\n".join(lines)
|
||||
@@ -120,8 +124,8 @@ def _format_verification(data: dict, account_email: str = "") -> str:
|
||||
|
||||
def _format_normal(data: dict, account_email: str = "") -> str:
|
||||
lines = [
|
||||
f"*📧 {_escape(data.get('subject', '邮件摘要'))}*",
|
||||
"━━━━━━━━━━━━━━━━━━",
|
||||
f"📧 *{_escape(data.get('subject', '邮件摘要'))}*",
|
||||
f"━━━━━━━━━━━━━━━━━━",
|
||||
f"*收件人:* {_escape(data.get('recipient', '未知'))}",
|
||||
f"*发件人:* {_escape(data.get('sender', '未知'))}",
|
||||
f"*账户:* {_escape(account_email)}",
|
||||
|
||||
Reference in New Issue
Block a user