跳转到内容
搜索文档

更新日志

Cloudflare 的最新更新与改进。

Back to all posts

使用 Queues 订阅 Email Sending 事件

您现在可以通过 Queues 事件订阅 订阅 Email Sending 事件,并在队列中接收出站交易性电子邮件的生命周期事件。每个订阅的作用域仅限于一个发送域——可以是区域顶点(如 example.com),也可以是已验证的发送子域(如 send.example.com)。

发布了六种事件类型:message.deliveredmessage.deferredmessage.bouncedmessage.failedmessage.rejectedmessage.complained。使用它们来跟踪送达率、对退信和投诉做出反应,并驱动抑制或重试逻辑。Email Routing 事件不会发布在此数据源上。

每个事件都包含邮件详细信息、递送状态和 SMTP 响应:

{
	"type": "cf.email.sending.message.delivered",
	"source": {
		"type": "email.sending",
		"zoneId": "023e105f4ecef8ad9ca31a8372d0c353",
		"domain": "example.com"
	},
	"payload": {
		"messageId": "0101018f7d0c4d9a-msg-deadbeef",
		"recipient": "[email protected]",
		"terminal": true,
		"delivery": {
			"status": "delivered",
			"smtpStatusCode": "250"
		}
	}
}

请参阅 事件订阅 以查看所有事件类型和示例有效负载。