← Cloudflare Email Service / email-service / platform
Подписки на события
Подписки на события позволяют получать сообщения о событиях в вашем аккаунте Cloudflare. Продукты Cloudflare (например, KV, Workers AI, Workers) может публиковать структурированные события в очередь, которые затем можно использовать в Workers или HTTP pull consumers чтобы создавать собственные workflow, интеграции или логику.
Подробнее о Подписки на события, см. руководство по управлению.
Доступные события Email Sending
Подписки на события Email Sending публикуют события жизненного цикла исходящих транзакционных писем для сообщений, отправленных с включённого домена отправки. Каждая подписка привязана к одному домену отправки: либо к корню зоны, например example.com, или подтвержденный поддомен для отправки, например, send.example.com.
События Email Routing, включая входящие пересылки, ответы, события маршрутизации, инициированные Worker, и доставки подтверждённым получателям маршрутизации, не публикуются как события Email Sending.
message.delivered
Срабатывает, когда почтовый сервер получателя принимает сообщение.
Пример:
{
"type": "cf.email.sending.message.delivered",
"source": {
"type": "email.sending",
"zoneId": "023e105f4ecef8ad9ca31a8372d0c353",
"domain": "example.com"
},
"payload": {
"eventId": "0190d0c4-7e9a-7b3c-9f12-1a2b3c4d5e6f",
"messageId": "0101018f7d0c4d9a-msg-deadbeef",
"sender": "[email protected]",
"recipient": "[email protected]",
"subject": "Welcome",
"terminal": true,
"delivery": {
"status": "delivered",
"provider": "gmail",
"deliveryTimeMs": 1234,
"smtpStatusCode": "250",
"smtpEnhancedStatusCode": "2.0.0",
"smtpResponse": "250 2.0.0 OK 1714820445 a1b2c3 - gsmtp"
}
},
"metadata": {
"accountId": "f9f79265f388666de8122cfb508d7776",
"eventSubscriptionId": "1830c4bb612e43c3af7f4cada31fbf3f",
"eventSchemaVersion": 1,
"eventTimestamp": "2026-06-01T02:48:57.132Z"
}
}message.deferred
Срабатывает при временном сбое доставки, когда попытки повторной доставки ещё продолжаются.
Пример:
{
"type": "cf.email.sending.message.deferred",
"source": {
"type": "email.sending",
"zoneId": "023e105f4ecef8ad9ca31a8372d0c353",
"domain": "send.example.com"
},
"payload": {
"eventId": "0190d0c4-7e9b-7714-9004-11f0b6d9a341",
"messageId": "0101018f7d0c4d9a-msg-deferred",
"sender": "[email protected]",
"recipient": "[email protected]",
"subject": "Your receipt",
"terminal": false,
"delivery": {
"status": "deferred",
"provider": "external_smtp",
"deliveryTimeMs": 2143,
"smtpStatusCode": "451",
"smtpEnhancedStatusCode": "4.2.0",
"smtpResponse": "451 4.2.0 Temporary mailbox error"
},
"bounce": {
"type": "soft",
"classification": "temporary_failure",
"reason": "451 4.2.0 Temporary mailbox error"
}
},
"metadata": {
"accountId": "f9f79265f388666de8122cfb508d7776",
"eventSubscriptionId": "1830c4bb612e43c3af7f4cada31fbf3f",
"eventSchemaVersion": 1,
"eventTimestamp": "2026-06-01T02:48:57.132Z"
}
}message.bounced
Срабатывает при постоянном отказе в доставке или когда исчерпаны попытки повторной доставки временных сбоев.
Пример:
{
"type": "cf.email.sending.message.bounced",
"source": {
"type": "email.sending",
"zoneId": "023e105f4ecef8ad9ca31a8372d0c353",
"domain": "send.example.com"
},
"payload": {
"eventId": "0190d0c4-7ea1-7af2-8b88-c1d2e3f4a5b6",
"messageId": "0101018f7d0c4d9a-msg-bounced",
"sender": "[email protected]",
"recipient": "[email protected]",
"subject": "Your receipt",
"terminal": true,
"delivery": {
"status": "bounced",
"provider": "external_smtp",
"deliveryTimeMs": 2143,
"smtpStatusCode": "550",
"smtpEnhancedStatusCode": "5.1.1",
"smtpResponse": "550 5.1.1 User unknown"
},
"bounce": {
"type": "hard",
"classification": "permanent_failure",
"reason": "550 5.1.1 User unknown"
}
},
"metadata": {
"accountId": "f9f79265f388666de8122cfb508d7776",
"eventSubscriptionId": "1830c4bb612e43c3af7f4cada31fbf3f",
"eventSchemaVersion": 1,
"eventTimestamp": "2026-06-01T02:48:57.132Z"
}
}message.failed
Срабатывает при внутренней ошибке доставки или ошибке, не связанной с SMTP.
Пример:
{
"type": "cf.email.sending.message.failed",
"source": {
"type": "email.sending",
"zoneId": "023e105f4ecef8ad9ca31a8372d0c353",
"domain": "example.com"
},
"payload": {
"eventId": "0190d0c4-81c1-7bc6-9344-829cd9001a12",
"messageId": "0101018f7d0c4d9a-msg-failed",
"sender": "[email protected]",
"recipient": "[email protected]",
"subject": "Welcome",
"terminal": true,
"delivery": {
"status": "failed"
},
"failure": {
"reason": "delivery_failed"
}
},
"metadata": {
"accountId": "f9f79265f388666de8122cfb508d7776",
"eventSubscriptionId": "1830c4bb612e43c3af7f4cada31fbf3f",
"eventSchemaVersion": 1,
"eventTimestamp": "2026-06-01T02:48:57.132Z"
}
}message.rejected
Срабатывает, когда сообщение отклоняется политикой до доставки, включая подавление, отклонение при проверке или отклонение как спам.
Пример:
{
"type": "cf.email.sending.message.rejected",
"source": {
"type": "email.sending",
"zoneId": "023e105f4ecef8ad9ca31a8372d0c353",
"domain": "example.com"
},
"payload": {
"eventId": "0190d0c4-830a-77e5-8fa0-8d10f4e8dc8b",
"messageId": "0101018f7d0c4d9a-msg-rejected",
"sender": "[email protected]",
"recipient": "[email protected]",
"subject": "Welcome",
"terminal": true,
"delivery": {
"status": "rejected"
},
"rejection": {
"reason": "suppressed",
"party": "recipient",
"detail": "Recipient is suppressed"
}
},
"metadata": {
"accountId": "f9f79265f388666de8122cfb508d7776",
"eventSubscriptionId": "1830c4bb612e43c3af7f4cada31fbf3f",
"eventSchemaVersion": 1,
"eventTimestamp": "2026-06-01T02:48:57.132Z"
}
}message.complained
Срабатывает, когда доставленное сообщение помечается получателем как спам через цикл обратной связи.
Пример:
{
"type": "cf.email.sending.message.complained",
"source": {
"type": "email.sending",
"zoneId": "023e105f4ecef8ad9ca31a8372d0c353",
"domain": "send.example.com"
},
"payload": {
"eventId": "0190d0c4-9f01-7c44-b2a1-aabbccddeeff",
"messageId": "0101018f7d0c4d9a-msg-complained",
"sender": "[email protected]",
"recipient": "[email protected]",
"terminal": true,
"delivery": {
"status": "complained"
},
"complaint": {
"type": "abuse"
}
},
"metadata": {
"accountId": "f9f79265f388666de8122cfb508d7776",
"eventSubscriptionId": "1830c4bb612e43c3af7f4cada31fbf3f",
"eventSchemaVersion": 1,
"eventTimestamp": "2026-06-01T02:48:57.132Z"
}
}