fix: 添加邮件请求日志,便于排查发送问题

This commit is contained in:
2026-06-01 17:44:39 +08:00
parent 23810cf180
commit 89b5a69325
9 changed files with 68 additions and 30332 deletions

View File

@@ -18,7 +18,9 @@ def register_email_routes(app):
def api_email_send():
"""发送邮件通知"""
data = request.get_json()
log_message(f"📨 收到邮件请求: {data}")
if not data:
log_message(f"❌ 无效数据: content-type={request.content_type}")
return jsonify({'error': '无效数据'}), 400
to_email = data.get('to')
@@ -26,6 +28,7 @@ def register_email_routes(app):
body = data.get('body')
if not to_email or not subject or not body:
log_message(f"❌ 缺少参数: to={to_email}, subject={subject}, body_len={len(body) if body else 0}")
return jsonify({'error': '缺少必要参数'}), 400
try: