Custom_args 在 sendgrid V3 API 中不工作,但 unique_args 发送电子邮件但在 event_callback 中不工作
Custom_args not working in sendgrid V3 API but unique_args sends email but not in event_callback
我使用 sendgrid v3 api 发送电子邮件。正如 V3 API 文档中所述,我使用 custom_args 在事件回调中获取我的参数,但它显示 400 个错误请求,而我使用 unique_args,电子邮件已发送但事件回调确实如此不发送我的 unique_args 参数。
data = {"content": [{"value": "dfafds", "type": "text/plain"}], "attachments": [{"content": "UEsDBB......QACAgIAAA=", "type": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "content_id": "BqzZqz7LaqO9", "filename": "Contactmanager-company.xlsx", "disposition": "attachment"}], "from": {"email": "bishnusyangja@gmail.com"}, "personalizations": [{"to": [{"email": "bishnu@janakitech.com"}], "custom_args": {"email_msg_id": 106}, "subject": "daff"}]}
来自发送网格的事件回调响应是
[{"sg_event_id": "aoDNXRAeRuaCAVRiutD-fg",
"sg_message_id": "epJqlw1JThGw--dDTC1oCQ.filter0099p3las1-8681-5B853F95-29.0",
"smtp-id": "epJqlw1JThGw--dDTC1oCQ@ismtpd0006p1maa1.sendgrid.net",
"timestamp": 1535459222,
"email": "bishnu@janakitech.com",
"event": "processed"}]
我可能 custom_args 在事件回调响应中,在这个响应中我需要 email_msg_id
这里缺少什么?
在custom_args中,data_type必须是字符串。我使用字符串数据将其修复为
"custom_args": {'email_msg_id': '106'}.
我使用 sendgrid v3 api 发送电子邮件。正如 V3 API 文档中所述,我使用 custom_args 在事件回调中获取我的参数,但它显示 400 个错误请求,而我使用 unique_args,电子邮件已发送但事件回调确实如此不发送我的 unique_args 参数。
data = {"content": [{"value": "dfafds", "type": "text/plain"}], "attachments": [{"content": "UEsDBB......QACAgIAAA=", "type": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "content_id": "BqzZqz7LaqO9", "filename": "Contactmanager-company.xlsx", "disposition": "attachment"}], "from": {"email": "bishnusyangja@gmail.com"}, "personalizations": [{"to": [{"email": "bishnu@janakitech.com"}], "custom_args": {"email_msg_id": 106}, "subject": "daff"}]}
来自发送网格的事件回调响应是
[{"sg_event_id": "aoDNXRAeRuaCAVRiutD-fg",
"sg_message_id": "epJqlw1JThGw--dDTC1oCQ.filter0099p3las1-8681-5B853F95-29.0",
"smtp-id": "epJqlw1JThGw--dDTC1oCQ@ismtpd0006p1maa1.sendgrid.net",
"timestamp": 1535459222,
"email": "bishnu@janakitech.com",
"event": "processed"}]
我可能 custom_args 在事件回调响应中,在这个响应中我需要 email_msg_id
这里缺少什么?
在custom_args中,data_type必须是字符串。我使用字符串数据将其修复为 "custom_args": {'email_msg_id': '106'}.