fix: 添加邮件请求日志,便于排查发送问题
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user