diff --git a/public/__redirects b/public/__redirects index ac8758bb81c..0557f4e2396 100644 --- a/public/__redirects +++ b/public/__redirects @@ -872,6 +872,14 @@ /durable-objects/what-are-durable-objects/ /durable-objects/concepts/what-are-durable-objects/ 301 /durable-objects/observability/graphql-analytics/ /durable-objects/observability/metrics-and-analytics/ 301 +# Email Service information architecture +/email-service/local-development/ /email-service/observability/local-development/ 301 +/email-service/local-development/sending/ /email-service/observability/local-development/sending/ 301 +/email-service/local-development/routing/ /email-service/observability/local-development/routing/ 301 +/email-service/platform/email-routing-rest-api/ /email-service/api/email-routing-rest-api/ 301 +/email-service/platform/email-sending-rest-api/ /email-service/api/email-sending-rest-api/ 301 +/email-service/platform/event-subscriptions/ /email-service/reference/event-subscriptions/ 301 + # Email Routing -> Email Service (product merged) # Top-level /email-routing/ /email-service/ 301 @@ -902,7 +910,7 @@ /email-routing/email-workers/reply-email-workers/ /email-service/api/route-emails/email-handler/#reply-to-emails 301 /email-routing/email-workers/send-email-workers/ /email-service/api/send-emails/workers-api/ 301 /email-routing/email-workers/runtime-api/ /email-service/api/route-emails/email-handler/ 301 -/email-routing/email-workers/local-development/ /email-service/local-development/routing/ 301 +/email-routing/email-workers/local-development/ /email-service/observability/local-development/routing/ 301 # Troubleshooting /email-routing/troubleshooting/ /email-service/reference/troubleshooting/ 301 diff --git a/src/content/changelog/email-service/2025-04-08-local-development.mdx b/src/content/changelog/email-service/2025-04-08-local-development.mdx index 6bf0b66cfe7..e8b60ec9297 100644 --- a/src/content/changelog/email-service/2025-04-08-local-development.mdx +++ b/src/content/changelog/email-service/2025-04-08-local-development.mdx @@ -75,4 +75,4 @@ This is what you get in the console: } ``` -Local development is a critical part of the development flow, and also works for sending, replying and forwarding emails. See [our documentation](/email-service/local-development/routing/) for more information. +Local development is part of the development flow. It also works for sending, replying, and forwarding emails. For more information, refer to [local development for email routing](/email-service/observability/local-development/routing/). diff --git a/src/content/changelog/email-service/2026-07-15-event-subscriptions.mdx b/src/content/changelog/email-service/2026-07-15-event-subscriptions.mdx index 53d983ab22b..25a01c9c5c2 100644 --- a/src/content/changelog/email-service/2026-07-15-event-subscriptions.mdx +++ b/src/content/changelog/email-service/2026-07-15-event-subscriptions.mdx @@ -33,4 +33,4 @@ Each event includes the message details, delivery status, and SMTP response: } ``` -Refer to [Event subscriptions](/email-service/platform/event-subscriptions/) to see all event types and example payloads. +Refer to [Event subscriptions](/email-service/reference/event-subscriptions/) to see all event types and example payloads. diff --git a/src/content/docs/email-service/platform/email-routing-rest-api.mdx b/src/content/docs/email-service/api/email-routing-rest-api.mdx similarity index 100% rename from src/content/docs/email-service/platform/email-routing-rest-api.mdx rename to src/content/docs/email-service/api/email-routing-rest-api.mdx diff --git a/src/content/docs/email-service/platform/email-sending-rest-api.mdx b/src/content/docs/email-service/api/email-sending-rest-api.mdx similarity index 100% rename from src/content/docs/email-service/platform/email-sending-rest-api.mdx rename to src/content/docs/email-service/api/email-sending-rest-api.mdx diff --git a/src/content/docs/email-service/api/index.mdx b/src/content/docs/email-service/api/index.mdx index c4e2a9ca77f..47693a86d8b 100644 --- a/src/content/docs/email-service/api/index.mdx +++ b/src/content/docs/email-service/api/index.mdx @@ -1,9 +1,9 @@ --- -title: API reference +title: API description: REST API and Workers API reference for sending and routing emails with Email Service. pcx_content_type: navigation sidebar: - order: 5 + order: 8 group: hideIndex: true products: diff --git a/src/content/docs/email-service/api/route-emails/email-handler.mdx b/src/content/docs/email-service/api/route-emails/email-handler.mdx index 86ceb54955d..0eec90b25f0 100644 --- a/src/content/docs/email-service/api/route-emails/email-handler.mdx +++ b/src/content/docs/email-service/api/route-emails/email-handler.mdx @@ -445,8 +445,8 @@ async function processEmail(message, env) { ## Next steps -- Test locally: [Email routing development](/email-service/local-development/routing/) -- Manage rules and addresses programmatically with the [Email Routing REST API](/email-service/platform/email-routing-rest-api/) +- Test locally: [Email routing development](/email-service/observability/local-development/routing/) +- Manage rules and addresses programmatically with the [Email Routing REST API](/email-service/api/email-routing-rest-api/) - Set up [email routing configuration](/email-service/configuration/email-routing-addresses/) - See [email routing examples](/email-service/examples/email-routing/) for advanced email processing - Learn about [spam filtering](/email-service/examples/email-routing/spam-filtering/) with Workers diff --git a/src/content/docs/email-service/api/send-emails/rest-api.mdx b/src/content/docs/email-service/api/send-emails/rest-api.mdx index b2d62c79627..039c30cfd1b 100644 --- a/src/content/docs/email-service/api/send-emails/rest-api.mdx +++ b/src/content/docs/email-service/api/send-emails/rest-api.mdx @@ -1,7 +1,7 @@ --- title: REST API -description: Send emails from any application using the Email Service REST API with standard HTTP requests. -pcx_content_type: concept +description: Email Sending REST API requests, responses, authentication, and errors. +pcx_content_type: reference sidebar: order: 2 products: @@ -22,7 +22,7 @@ Authenticate with a [Cloudflare API token](/fundamentals/api/get-started/create- Authorization: Bearer ``` -## Send an email +## Request example ```bash curl "https://api.cloudflare.com/client/v4/accounts/{account_id}/email/sending/send" \ @@ -111,7 +111,7 @@ A successful response returns the delivery status for each recipient: The REST API returns recipient-grouped delivery status. The [Workers binding](/email-service/api/send-emails/workers-api/) returns a single `messageId` per `send()` call instead. ::: -## Error handling +## Error responses The REST API returns standard Cloudflare API error responses. A failed request returns an `errors` array with numeric error codes and machine-readable messages: @@ -152,9 +152,9 @@ REST API error codes: The REST API returns standard Cloudflare API numeric error codes, while the [Workers binding](/email-service/api/send-emails/workers-api/) throws errors with string codes (for example, `E_SENDER_NOT_VERIFIED`). Refer to the [Workers API error codes table](/email-service/api/send-emails/workers-api/#error-codes) for the string error codes. ::: -## Next steps +## Related resources - Refer to the [Email Sending API reference](/api/resources/email_sending/methods/send/) for the full request and response schemas. -- See the [Workers API](/email-service/api/send-emails/workers-api/) for sending emails directly from Cloudflare Workers using bindings. +- Refer to the [Email Sending Workers API](/email-service/api/send-emails/workers-api/) for sending emails directly from Cloudflare Workers using bindings. - See [SMTP](/email-service/api/send-emails/smtp/) for sending from any SMTP-capable application or mail client. - Review [email headers](/email-service/reference/headers/) for threading, list management, and custom tracking headers. diff --git a/src/content/docs/email-service/api/send-emails/smtp.mdx b/src/content/docs/email-service/api/send-emails/smtp.mdx index 82a13dad8bb..bc8bdf49803 100644 --- a/src/content/docs/email-service/api/send-emails/smtp.mdx +++ b/src/content/docs/email-service/api/send-emails/smtp.mdx @@ -1,7 +1,7 @@ --- title: SMTP -description: Send emails from any SMTP-capable application or mail client using authenticated SMTP submission on smtp.mx.cloudflare.net. -pcx_content_type: concept +description: Email Service SMTP endpoint, authentication, limits, responses, and errors. +pcx_content_type: reference sidebar: order: 3 products: @@ -179,7 +179,7 @@ For authentication problems related to SPF, DKIM, or DMARC on the recipient side - [Send email over SMTP](/email-service/examples/email-sending/smtp/) — examples for curl, Nodemailer, Python, and PHP. - [REST API](/email-service/api/send-emails/rest-api/) — send emails over HTTPS. -- [Workers API](/email-service/api/send-emails/workers-api/) — send emails from a Cloudflare Worker using bindings. +- [Email Sending Workers API](/email-service/api/send-emails/workers-api/) — send emails from a Cloudflare Worker using bindings. - [Domain configuration](/email-service/configuration/domains/) — onboard a domain for Email Sending. - [MTA-STS](/email-service/configuration/mta-sts/) — enforce TLS for incoming mail. - [Email headers](/email-service/reference/headers/) — supported headers and threading hints. diff --git a/src/content/docs/email-service/api/send-emails/workers-api.mdx b/src/content/docs/email-service/api/send-emails/workers-api.mdx index 75c8a94c4db..c1304651ca9 100644 --- a/src/content/docs/email-service/api/send-emails/workers-api.mdx +++ b/src/content/docs/email-service/api/send-emails/workers-api.mdx @@ -1,7 +1,7 @@ --- -title: Workers API -description: Send emails directly from Cloudflare Workers using the Email Service binding and send() method. -pcx_content_type: concept +title: Email Sending Workers API +description: Email Sending Workers API methods, types, binding, and errors. +pcx_content_type: reference sidebar: order: 1 products: @@ -27,7 +27,7 @@ Configure a `send_email` binding in your Wrangler configuration file to enable e -You can restrict which senders and recipients a binding may use. Refer to [Configure send bindings](/email-service/configuration/send-bindings/) for the available restriction attributes and examples. +You can restrict which senders and recipients a binding may use. Refer to [send bindings](/email-service/configuration/send-bindings/) for the available restriction attributes and examples. ## `send()` method @@ -79,7 +79,7 @@ interface EmailSendResult { ``` :::note[Local development with binary attachments] -When using `wrangler dev` without [remote bindings](/workers/local-development/#remote-bindings), `ArrayBuffer` and `ArrayBufferView` content in attachments cannot be serialized by the local simulator. Refer to [local development for email sending](/email-service/local-development/sending/#known-limitations). +When using `wrangler dev` without [remote bindings](/workers/local-development/#remote-bindings), `ArrayBuffer` and `ArrayBufferView` content in attachments cannot be serialized by the local simulator. Refer to [local development for email sending](/email-service/observability/local-development/sending/#known-limitations). ::: ### Basic usage diff --git a/src/content/docs/email-service/configuration/email-routing-addresses.mdx b/src/content/docs/email-service/configuration/email-routing-addresses.mdx index b14a81b5816..a3cd3e00c6e 100644 --- a/src/content/docs/email-service/configuration/email-routing-addresses.mdx +++ b/src/content/docs/email-service/configuration/email-routing-addresses.mdx @@ -142,6 +142,6 @@ If a routing rule for `user+detail@example.com` already exists, it takes precede ## Next steps - [Email handler](/email-service/api/route-emails/email-handler/) — process emails programmatically with the `email()` handler. -- [Email Routing REST API](/email-service/platform/email-routing-rest-api/) — manage routing rules and destination addresses programmatically. +- [Email Routing REST API](/email-service/api/email-routing-rest-api/) — manage routing rules and destination addresses programmatically. - [Domain configuration](/email-service/configuration/domains/) — manage DNS records for Email Routing. - [Email routing examples](/email-service/examples/email-routing/) — advanced patterns including spam filtering and email storage. diff --git a/src/content/docs/email-service/configuration/index.mdx b/src/content/docs/email-service/configuration/index.mdx index 75f6fc4a4f0..36b664fe700 100644 --- a/src/content/docs/email-service/configuration/index.mdx +++ b/src/content/docs/email-service/configuration/index.mdx @@ -3,7 +3,7 @@ title: Configuration description: Configure domains, routing rules, suppressions, and MTA-STS for Cloudflare Email Service. pcx_content_type: navigation sidebar: - order: 4 + order: 6 group: hideIndex: true products: diff --git a/src/content/docs/email-service/configuration/send-bindings.mdx b/src/content/docs/email-service/configuration/send-bindings.mdx index a5946bc4669..77dbf410330 100644 --- a/src/content/docs/email-service/configuration/send-bindings.mdx +++ b/src/content/docs/email-service/configuration/send-bindings.mdx @@ -1,7 +1,7 @@ --- -title: Configure send bindings -description: Restrict which senders and recipients a Workers send_email binding can use with Email Service. -pcx_content_type: how-to +title: Send bindings +description: Email Service send binding restrictions and Wrangler configuration variants. +pcx_content_type: configuration sidebar: order: 5 products: @@ -10,11 +10,11 @@ products: import { WranglerConfig } from "~/components"; -When you add a `send_email` binding to a Worker, you can restrict which addresses it may send from and to. Configure these restrictions in your Wrangler configuration file. For the binding API itself, refer to the [Workers API](/email-service/api/send-emails/workers-api/). +When you add a `send_email` binding to a Worker, you can restrict its sender and recipient addresses. The following Wrangler configuration variants apply these restrictions. For the binding API, refer to the [Email Sending Workers API](/email-service/api/send-emails/workers-api/). ## Binding types -Each entry in `send_email` can be configured to restrict what the binding can do. The sender address must always belong to a domain you have onboarded to Email Service. +Each `send_email` entry supports a different restriction choice. The sender address must belong to an onboarded Email Service domain. - **No restriction attribute**: The binding can send to any verified destination address in your account. - **`destination_address`**: The binding can only send to the single destination address configured here. If you call `send()` with `to` set to `null` or `undefined`, the configured address is used. @@ -57,5 +57,5 @@ Each entry in `send_email` can be configured to restrict what the binding can do ## Next steps -- [Workers API](/email-service/api/send-emails/workers-api/) — send emails from a Worker using the binding. +- [Email Sending Workers API](/email-service/api/send-emails/workers-api/) — send emails from a Worker using the binding. - [Domain configuration](/email-service/configuration/domains/) — onboard the domains you send from. diff --git a/src/content/docs/email-service/configuration/subdomains.mdx b/src/content/docs/email-service/configuration/subdomains.mdx index 1c524673aa5..b2b93d340f6 100644 --- a/src/content/docs/email-service/configuration/subdomains.mdx +++ b/src/content/docs/email-service/configuration/subdomains.mdx @@ -1,5 +1,5 @@ --- -title: Subdomains +title: Configure subdomains description: Configure Email Sending and Email Routing on subdomains within your zone. pcx_content_type: how-to sidebar: diff --git a/src/content/docs/email-service/examples/email-routing/hard-bounce-handling.mdx b/src/content/docs/email-service/examples/email-routing/hard-bounce-handling.mdx index 41f9b9c36e4..9bcc7d9f906 100644 --- a/src/content/docs/email-service/examples/email-routing/hard-bounce-handling.mdx +++ b/src/content/docs/email-service/examples/email-routing/hard-bounce-handling.mdx @@ -1,7 +1,7 @@ --- -title: Handle hard bounce emails -description: Detect and process hard bounce notifications in Email Service to maintain sender reputation. -pcx_content_type: how-to +title: Hard bounce handling +description: Detect hard bounce notifications and store recipients in Workers KV. +pcx_content_type: example summary: Detect and handle hard bounce emails to maintain sender reputation and manage undeliverable addresses sidebar: order: 4 @@ -11,9 +11,9 @@ products: import { WranglerConfig } from "~/components"; -Handle hard bounce notifications to automatically remove invalid email addresses from your mailing lists and maintain good sender reputation. +This example detects hard bounce notifications and stores recipient addresses in Workers KV. -## What are hard bounces? +## Identify hard bounces Hard bounces occur when an email cannot be delivered due to permanent reasons: @@ -22,7 +22,7 @@ Hard bounces occur when an email cannot be delivered due to permanent reasons: - Mailbox full: The recipient's mailbox has exceeded storage limits - Email blocked: The recipient's server permanently rejects emails -## Configuration +## Configure bindings Configure your worker to handle bounce notifications: @@ -44,7 +44,7 @@ Configure your worker to handle bounce notifications: -## Hard bounce detection +## Detect hard bounces ```javascript import * as PostalMime from "postal-mime"; @@ -187,7 +187,7 @@ async function handleHardBounce(bounceInfo, env) { } ``` -## Testing hard bounce handling +## Test the handler Create a test bounce notification: @@ -222,7 +222,7 @@ Message-ID: Welcome! Thanks for signing up.' ``` -## Checking suppression list +## Check the suppression list Add a utility function to check if an email is suppressed before sending: diff --git a/src/content/docs/email-service/examples/email-routing/spam-filtering.mdx b/src/content/docs/email-service/examples/email-routing/spam-filtering.mdx index ff4904e5370..4f2d4c3cb33 100644 --- a/src/content/docs/email-service/examples/email-routing/spam-filtering.mdx +++ b/src/content/docs/email-service/examples/email-routing/spam-filtering.mdx @@ -1,15 +1,15 @@ --- title: Spam filtering -description: Build spam detection for Email Service with keyword analysis, domain reputation checks, and AI-based filtering. +description: Filter email with subject keywords and trusted-domain heuristics. pcx_content_type: example -summary: Implement intelligent spam detection with keyword analysis, domain reputation, and machine learning techniques +summary: Filter email with subject keywords and trusted-domain heuristics sidebar: order: 2 products: - email-service --- -Build spam filtering systems with keyword matching, domain validation, and intelligent detection methods for effective email security. +This example scores incoming email using subject keywords and sender-domain heuristics. ## Basic spam filter @@ -153,9 +153,9 @@ function getScoreRange(score: number): string { } ``` -## Advanced spam detection with AI +## Optional Workers AI integration -For more sophisticated spam detection, you can enhance the basic filter using [Workers AI](/workers-ai/) to analyze email content with machine learning models. This approach can identify subtle spam patterns that keyword-based filters might miss. +The basic spam filter uses simple heuristic checks. You can optionally use [Workers AI](/workers-ai/) to analyze email content. ## Next steps diff --git a/src/content/docs/email-service/examples/email-sending/magic-link.mdx b/src/content/docs/email-service/examples/email-sending/magic-link.mdx index 34d1c20fff4..57fea887809 100644 --- a/src/content/docs/email-service/examples/email-sending/magic-link.mdx +++ b/src/content/docs/email-service/examples/email-sending/magic-link.mdx @@ -1,8 +1,8 @@ --- -summary: Implement passwordless authentication by sending secure, time-limited login links via email. +summary: Generate and email a login link from a Worker. pcx_content_type: example -title: Magic link authentication -description: Passwordless login system using magic links sent via email with JWT tokens and session management. +title: Email a login link +description: Generate and email a login link from a Worker. sidebar: order: 7 products: @@ -11,7 +11,7 @@ products: import { WranglerConfig } from "~/components"; -This example demonstrates how to send a magic link email for passwordless authentication using Cloudflare Email Service. +This example generates a login link and emails it with Cloudflare Email Service. Configure the email binding in your Wrangler configuration file: @@ -28,7 +28,7 @@ Configure the email binding in your Wrangler configuration file: -The Worker exposes a `POST /send-magic-link` route that validates the submitted email address, generates a single-use token, and emails the recipient a time-limited login link. The following code implements that handler. +The Worker exposes a `POST /send-magic-link` route. It checks the email address, generates a random token, and emails a login link. ```typescript interface Env { @@ -60,7 +60,7 @@ async function handleSendMagicLink( }); } - // Generate a simple secure token (you would implement proper JWT/token handling) + // Generate a random token for the login link const token = crypto.randomUUID(); const magicUrl = `https://${env.DOMAIN}/login?token=${token}`; @@ -73,14 +73,12 @@ async function handleSendMagicLink(

Login to your account

Click the link below to log in:

Login Now

-

This link expires in 15 minutes.

`, text: ` Login to your account Click this link to log in: ${magicUrl} - This link expires in 15 minutes. `, }); diff --git a/src/content/docs/email-service/examples/email-sending/signup-flow.mdx b/src/content/docs/email-service/examples/email-sending/signup-flow.mdx index 156b1e509d4..ac68b51ade8 100644 --- a/src/content/docs/email-service/examples/email-sending/signup-flow.mdx +++ b/src/content/docs/email-service/examples/email-sending/signup-flow.mdx @@ -192,6 +192,6 @@ function isValidEmail(email: string): boolean { ## Next steps -- [Magic link authentication](/email-service/examples/email-sending/magic-link/) — passwordless login flow using a similar token pattern. +- [Email a login link](/email-service/examples/email-sending/magic-link/) — generate and email a link using a similar token pattern. - [Send method](/email-service/api/send-emails/workers-api/) — full reference for the `send()` method. - [Deliverability](/email-service/concepts/deliverability/) — keep verification emails out of spam folders. diff --git a/src/content/docs/email-service/examples/email-sending/sync-recipient-records.mdx b/src/content/docs/email-service/examples/email-sending/sync-recipient-records.mdx index 3f631ad6250..9ffa369f340 100644 --- a/src/content/docs/email-service/examples/email-sending/sync-recipient-records.mdx +++ b/src/content/docs/email-service/examples/email-sending/sync-recipient-records.mdx @@ -17,7 +17,7 @@ import { WranglerConfig, } from "~/components"; -Use [Email Sending event subscriptions](/email-service/platform/event-subscriptions/) to update application records after delivery problems. This example uses [Cloudflare Queues](/queues/) and [Workers KV](/kv/) to remove recipients from transactional notifications. +Use [Email Sending event subscriptions](/email-service/reference/event-subscriptions/) to update application records after delivery problems. This example uses [Cloudflare Queues](/queues/) and [Workers KV](/kv/) to remove recipients from transactional notifications. :::note[Suppression lists] Email Sending automatically [suppresses](/email-service/concepts/suppressions/) hard bounces and spam complaints. This example also prevents your application from selecting those recipients. @@ -47,7 +47,7 @@ Remove records for every `message.complained` event. These events indicate that Remove bounced records only when `payload.bounce.type` is `"hard"`. Temporary failures produce `message.deferred` events while retries remain. Exhausted temporary retries can produce `message.bounced` events with a `"soft"` bounce type. -For payload details, refer to [Available Email Sending events](/email-service/platform/event-subscriptions/#available-email-sending-events). +For payload details, refer to [Available Email Sending events](/email-service/reference/event-subscriptions/#available-email-sending-events). ## Create the queue and subscription @@ -175,7 +175,7 @@ Monitor the dead letter queue for failed events. Reprocess them after fixing the ## Explore related resources -- [Event subscriptions](/email-service/platform/event-subscriptions/) — review event schemas. +- [Event subscriptions](/email-service/reference/event-subscriptions/) — review event schemas. - [Suppression lists](/email-service/concepts/suppressions/) — understand automatic suppressions. - [Queues retries](/queues/configuration/batching-retries/) — control message retries. - [Workers KV consistency](/kv/concepts/how-kv-works/#consistency) — account for propagation delays. diff --git a/src/content/docs/email-service/examples/index.mdx b/src/content/docs/email-service/examples/index.mdx index 21f50ed1800..ddcfdd13592 100644 --- a/src/content/docs/email-service/examples/index.mdx +++ b/src/content/docs/email-service/examples/index.mdx @@ -3,7 +3,7 @@ title: Examples description: Practical code examples for sending and routing emails with Cloudflare Email Service. pcx_content_type: navigation sidebar: - order: 6 + order: 5 group: hideIndex: true products: diff --git a/src/content/docs/email-service/get-started/index.mdx b/src/content/docs/email-service/get-started/index.mdx index 93438347e0d..9f760383de6 100644 --- a/src/content/docs/email-service/get-started/index.mdx +++ b/src/content/docs/email-service/get-started/index.mdx @@ -1,5 +1,5 @@ --- -title: Getting started +title: Get started description: Set up Cloudflare Email Service to send transactional emails and route incoming messages. pcx_content_type: navigation sidebar: diff --git a/src/content/docs/email-service/index.mdx b/src/content/docs/email-service/index.mdx index 2696aca632e..320f25f1644 100644 --- a/src/content/docs/email-service/index.mdx +++ b/src/content/docs/email-service/index.mdx @@ -1,6 +1,6 @@ --- title: Cloudflare Email Service -description: Send transactional emails and route incoming emails to Workers or email addresses with Cloudflare Email Service. +description: Send transactional email and route incoming email with Cloudflare Email Service. Arbitrary-recipient sending requires Workers Paid, while routing supports Workers Free and Paid. pcx_content_type: overview sidebar: order: 1 @@ -16,148 +16,29 @@ import { LinkTitleCard, Plan, RelatedProduct, - Tabs, - TabItem, LinkButton, } from "~/components"; -Send transactional emails and route incoming emails to Workers or email addresses +Send transactional email and route incoming email with Cloudflare Email Service. Arbitrary-recipient sending requires Workers Paid, while routing supports Workers Free and Paid. -Cloudflare Email Service provides powerful email capabilities: +Cloudflare Email Service sends transactional email and handles incoming email. -- **Email Sending** for outbound transactional emails +- **Email Sending** sends outbound transactional emails. -- **Email Routing** for handling incoming emails with Workers or routing to email addresses +- **Email Routing** processes incoming emails with Workers or forwards them to destination addresses. :::note -Sending to [verified destination addresses](/email-service/configuration/email-routing-addresses/#destination-addresses) in your account is free on all plans, even when only Email Routing is configured. +Sending to [verified destination addresses](/email-service/configuration/email-routing-addresses/#destination-addresses) in your account is free on Workers Free and Paid plans, even when only Email Routing is configured. ::: -Together, these two features make it possible for you to send and receive emails from your applications. For example, you can use Email Service for: - -- Transactional emails (welcome messages, password resets, order confirmations) -- Authentication flows (magic links, email verification, two-factor authentication) -- Notifications and alerts -- Custom email addresses (support@, contact@, orders@) -- Emails as a mode of interaction for agents, such as send an email to create an issue in ticket tracking - -Access Email Service directly from Cloudflare Workers using [bindings](/email-service/api/send-emails/workers-api/), from any platform using the [REST API](/email-service/api/send-emails/rest-api/), or over [authenticated SMTP](/email-service/api/send-emails/smtp/): - - - - -Send emails with the `EMAIL` binding and handle incoming emails with the `email()` handler in `src/index.ts`: - -```ts -interface Env { - EMAIL: SendEmail; -} - -export default { - // Handle HTTP requests (Email Sending) - async fetch(request, env, ctx): Promise { - // Send a welcome email - await env.EMAIL.send({ - to: "user@example.com", - from: "welcome@yourdomain.com", - subject: "Welcome to our service!", - html: "

Welcome!

Thanks for signing up.

", - text: "Welcome! Thanks for signing up.", - }); - - return new Response("Email sent successfully"); - }, - - // Handle incoming emails (Email Routing) - async email(message, env, ctx): Promise { - // Forward to support team - if (message.to.includes("support@yourdomain.com")) { - await message.forward("team@yourdomain.com"); - } - - // Send auto-reply - await env.EMAIL.send({ - to: message.from, - from: "noreply@yourdomain.com", - subject: "We received your message", - html: "

Thank you!

We'll get back to you soon.

", - }); - }, -} satisfies ExportedHandler; -``` - -Add the bindings to your Wrangler configuration file: - -```jsonc -{ - "$schema": "node_modules/wrangler/config-schema.json", - "name": "", - "main": "src/index.ts", - "compatibility_date": "$today", - - // Email sending - "send_email": [ - { - "name": "EMAIL" - } - ], - - // Email routing - "email": [ - { - "name": "EMAIL_HANDLER" - } - ] -} -``` - -
- - -```bash -curl "https://api.cloudflare.com/client/v4/accounts/{account_id}/email/sending/send" \ - --header "Authorization: Bearer " \ - --header "Content-Type: application/json" \ - --data '{ - "to": "user@example.com", - "from": "welcome@yourdomain.com", - "subject": "Welcome to our service!", - "html": "

Welcome!

Thanks for signing up.

", - "text": "Welcome! Thanks for signing up." - }' -``` - -Cloudflare also provides official SDKs for the REST API: [Node](/api/node/), [Python](/api/python/), and [Go](/api/go/). - -
- - -```sh -cat > mail.txt <" \ - --mail-from "welcome@yourdomain.com" \ - --mail-rcpt "user@example.com" \ - --upload-file mail.txt -``` - - -
- -See the full [API reference](/email-service/api/send-emails/) for the REST API, Workers binding, and SMTP. +Use Email Sending for account emails, order confirmations, and alerts. Use Email Routing to process or forward incoming messages. + +Send email through the [Workers binding](/email-service/api/send-emails/workers-api/), [REST API](/email-service/api/send-emails/rest-api/), or [authenticated SMTP](/email-service/api/send-emails/smtp/). Get started @@ -166,7 +47,7 @@ See the full [API reference](/email-service/api/send-emails/) for the REST API, ## Features - Send transactional emails with high deliverability and global performance. + Send transactional emails from Workers or other applications. @@ -174,14 +55,14 @@ See the full [API reference](/email-service/api/send-emails/) for the REST API, - Automatic IP reputation management and deliverability optimization. + Review email authentication and sender reputation factors. - Monitor email performance with comprehensive metrics and alerting. + Review sending and routing activity, metrics, and analytics. @@ -196,11 +77,11 @@ See the full [API reference](/email-service/api/send-emails/) for the REST API, ## Related products - Build serverless applications that can send emails directly from the edge. + Send and process email from Workers. - Process email events asynchronously with Workers Queues integration. + Send Email Sending events to a queue. - Store and analyze custom email metrics with Workers Analytics Engine. + Store custom metrics from email Workers. --- @@ -222,7 +103,7 @@ See the full [API reference](/email-service/api/send-emails/) for the REST API, href="/email-service/platform/limits/" icon="document" > - Learn about Email Service limits and quotas. + Review Email Service limits and quotas. - Understand Email Service pricing and plans. + Review Email Service pricing and plans. - Explore practical examples and implementation patterns. + View Email Service code examples. diff --git a/src/content/docs/email-service/observability/index.mdx b/src/content/docs/email-service/observability/index.mdx index f96cc663525..bc1a2d6a28a 100644 --- a/src/content/docs/email-service/observability/index.mdx +++ b/src/content/docs/email-service/observability/index.mdx @@ -1,9 +1,9 @@ --- pcx_content_type: navigation -title: Observability and logs -description: Monitor Email Service performance with logs, metrics, and analytics for sending and routing activity. +title: Observability +description: Monitor sending and routing with logs, metrics, and analytics. sidebar: - order: 8 + order: 9 group: hideIndex: true products: @@ -12,6 +12,6 @@ products: import { DirectoryListing } from "~/components"; -Monitor Email Service performance with logs, metrics, and analytics for sending and routing activity. +Monitor Email Service with local testing, logs, metrics, and analytics. diff --git a/src/content/docs/email-service/observability/local-development/index.mdx b/src/content/docs/email-service/observability/local-development/index.mdx new file mode 100644 index 00000000000..d587292c235 --- /dev/null +++ b/src/content/docs/email-service/observability/local-development/index.mdx @@ -0,0 +1,17 @@ +--- +title: Local development +description: Test Email Service applications locally with Wrangler. +pcx_content_type: navigation +sidebar: + order: 4 + group: + hideIndex: true +products: + - email-service +--- + +import { DirectoryListing } from "~/components"; + +Test Email Service applications locally with Wrangler before deployment. + + diff --git a/src/content/docs/email-service/local-development/routing.mdx b/src/content/docs/email-service/observability/local-development/routing.mdx similarity index 96% rename from src/content/docs/email-service/local-development/routing.mdx rename to src/content/docs/email-service/observability/local-development/routing.mdx index c19f00c9842..752962acbac 100644 --- a/src/content/docs/email-service/local-development/routing.mdx +++ b/src/content/docs/email-service/observability/local-development/routing.mdx @@ -1,6 +1,6 @@ --- -title: Email routing -description: Test Email Service routing Workers locally using wrangler dev with simulated incoming emails. +title: Test email routing locally +description: Test Email Service routing Workers locally with simulated incoming emails. pcx_content_type: how-to summary: Test email routing Workers locally using wrangler dev with simulated incoming emails sidebar: diff --git a/src/content/docs/email-service/local-development/sending.mdx b/src/content/docs/email-service/observability/local-development/sending.mdx similarity index 97% rename from src/content/docs/email-service/local-development/sending.mdx rename to src/content/docs/email-service/observability/local-development/sending.mdx index 28b254c6a53..7ced863c02b 100644 --- a/src/content/docs/email-service/local-development/sending.mdx +++ b/src/content/docs/email-service/observability/local-development/sending.mdx @@ -1,6 +1,6 @@ --- -title: Email sending -description: Test Email Service sending Workers locally using wrangler dev with simulated email delivery. +title: Test email sending locally +description: Test Email Service sending Workers locally with simulated delivery. pcx_content_type: how-to summary: Test email sending Workers locally using wrangler dev with simulated email delivery sidebar: diff --git a/src/content/docs/email-service/observability/logs.mdx b/src/content/docs/email-service/observability/logs.mdx index 29849c0f789..335fca25807 100644 --- a/src/content/docs/email-service/observability/logs.mdx +++ b/src/content/docs/email-service/observability/logs.mdx @@ -1,17 +1,15 @@ --- -title: Email logs -description: View and analyze Email Service sending and routing activity logs with authentication and delivery details. -pcx_content_type: how-to -summary: View and analyze email sending and routing activity logs with detailed authentication and delivery information +title: Activity log +description: Email Service activity statuses, authentication details, and message fields. +pcx_content_type: reference +summary: Email sending and routing statuses, authentication details, and message fields sidebar: order: 3 products: - email-service --- -Email Service provides comprehensive logging for both email sending and routing activities. Access detailed logs through the Cloudflare dashboard to monitor email flow, troubleshoot delivery issues, and analyze authentication status. - -## Activity log +The Email Service Activity log lists sending and routing events. Each event includes delivery and authentication details. The Activity log allows you to sort through all email activities and check actions taken by Email Service. In the dashboard you can filter the Activity log to a time range between 30 minutes and 30 days, or specify a custom range. @@ -19,7 +17,7 @@ The Activity log surfaces the same per-event data that is also available program For Email Routing, you can expand an individual email in the Activity log to inspect authentication results ([SPF](https://datatracker.ietf.org/doc/html/rfc7208), [DKIM](https://datatracker.ietf.org/doc/html/rfc6376), and [DMARC](https://datatracker.ietf.org/doc/html/rfc7489)). -### Email sending logs +## Email sending statuses For outbound emails sent through Email Service: @@ -29,7 +27,7 @@ For outbound emails sent through Email Service: - **Rejected**: Email was not sent because the recipient is on your account's [suppression list](/email-service/concepts/suppressions/). - **Failed**: Email failed to send due to configuration or authentication issues. -### Email routing logs +## Email routing statuses For inbound emails processed through Email Routing: @@ -40,7 +38,7 @@ For inbound emails processed through Email Routing: - **Delivery failed**: Email could not be delivered to the destination address. - **Error**: Email could not be processed due to an internal error. -## Viewing email details +## Email details Select any email in the Activity log to expand its details and view authentication and delivery information. @@ -72,28 +70,3 @@ For sent emails, expand the email in the Activity log to open the **Preview** se - **Raw**: The full raw [RFC 5322](https://datatracker.ietf.org/doc/html/rfc5322) message source. To make sent messages previewable, turn on [**Email preview**](/email-service/configuration/domains/#email-preview) for the sending domain. Previews cover messages sent while the setting is turned on and are retained for about seven days. New sending domains have **Email preview** turned on automatically. - -## Best practices for log monitoring - -### Regular review - -- Monitor logs daily during initial setup -- Check weekly for ongoing operations -- Review immediately after configuration changes - -### Key metrics to watch - -- Authentication failure rates -- Bounce patterns and trends -- Delivery success rates - -### Troubleshooting workflow - -1. Identify the issue: Use logs to pinpoint failure types -2. Check authentication: Verify SPF, DKIM, DMARC configuration -3. Adjust configuration: Make necessary DNS or routing changes -4. Monitor improvement: Track metrics after changes - ---- - -Email logs provide the visibility needed to maintain high deliverability and properly route incoming emails. Use this data to optimize your email configuration and quickly resolve any delivery issues. diff --git a/src/content/docs/email-service/observability/metrics-analytics.mdx b/src/content/docs/email-service/observability/metrics-analytics.mdx index e428820f806..26057f11083 100644 --- a/src/content/docs/email-service/observability/metrics-analytics.mdx +++ b/src/content/docs/email-service/observability/metrics-analytics.mdx @@ -307,6 +307,6 @@ The `*AdaptiveGroups` datasets use `Date` type filters (`date_geq`, `date_leq`) ## Next steps -- [Email logs](/email-service/observability/logs/) — view individual email activity in the dashboard. +- [Activity log](/email-service/observability/logs/) — view individual email activity in the dashboard. - [Audit logs](/email-service/observability/audit-logs/) — track configuration changes. - [GraphQL Analytics API](/analytics/graphql-api/) — full GraphQL API reference. diff --git a/src/content/docs/email-service/platform/changelog.mdx b/src/content/docs/email-service/platform/changelog.mdx new file mode 100644 index 00000000000..b0cca505667 --- /dev/null +++ b/src/content/docs/email-service/platform/changelog.mdx @@ -0,0 +1,13 @@ +--- +title: Changelog +description: Track Cloudflare Email Service updates, features, and fixes. +pcx_content_type: changelog +sidebar: + order: 3 +products: + - email-service +--- + +import { ProductChangelog } from "~/components"; + + diff --git a/src/content/docs/email-service/platform/index.mdx b/src/content/docs/email-service/platform/index.mdx index 53b25b7708b..a422b4d0a74 100644 --- a/src/content/docs/email-service/platform/index.mdx +++ b/src/content/docs/email-service/platform/index.mdx @@ -1,6 +1,6 @@ --- title: Platform -description: Email Service platform details including limits, pricing, and plan information. +description: Review limits, pricing, plans, and product changes. pcx_content_type: navigation sidebar: order: 10 @@ -12,6 +12,6 @@ products: import { DirectoryListing } from "~/components"; -Platform details for Cloudflare Email Service, including limits and pricing. +Review Email Service limits, pricing, plans, and product changes. diff --git a/src/content/docs/email-service/platform/event-subscriptions.mdx b/src/content/docs/email-service/reference/event-subscriptions.mdx similarity index 81% rename from src/content/docs/email-service/platform/event-subscriptions.mdx rename to src/content/docs/email-service/reference/event-subscriptions.mdx index 9dbf4c779bb..06ff0ffe73a 100644 --- a/src/content/docs/email-service/platform/event-subscriptions.mdx +++ b/src/content/docs/email-service/reference/event-subscriptions.mdx @@ -1,9 +1,9 @@ --- title: Event subscriptions -description: Subscribe to Email Sending lifecycle events with Queues. +description: Email Sending event names and Queues payload fields. pcx_content_type: reference sidebar: - order: 10 + order: 5 head: - tag: title content: Event subscriptions diff --git a/src/content/docs/email-service/reference/faq.mdx b/src/content/docs/email-service/reference/faq.mdx index 1b4cea8ac1d..7d90ed8b287 100644 --- a/src/content/docs/email-service/reference/faq.mdx +++ b/src/content/docs/email-service/reference/faq.mdx @@ -1,6 +1,6 @@ --- title: FAQ -description: Common questions about Email Service limits, sender reputation, marketing email support, and abuse reporting. +description: Answers about Email Service limits, reputation, supported email, and abuse. pcx_content_type: faq sidebar: order: 4 @@ -8,26 +8,30 @@ products: - email-service --- -Common questions about Cloudflare Email Service. +Find direct answers to common Cloudflare Email Service questions. -## Limits and usage +## Handle exceeded sending limits -Sending limits exist to prevent abuse and spam and to ensure high deliverability for all users. If you need higher limits, you can request a limit increase by contacting support or reaching out in the [Cloudflare Developers Discord](https://discord.cloudflare.com). If you exceed your limits, emails may be queued or rejected, and you will receive error responses with rate limit information. +Email Service may queue or reject emails that exceed sending limits. Error responses include rate-limit information. -### What is sender reputation? +Refer to [Email Service limits](/email-service/platform/limits/) for quota details and increase requests. -Sender reputation refers to how much inbox providers trust you to send good email to their users and not spam or scam. It is influenced by factors such as your email authentication setup, bounce and complaint rates, sending volume patterns, recipient engagement, and domain and IP history. +## Protect sender reputation -### Can I use this for marketing emails? +Sender reputation measures how much inbox providers trust your email. Authentication, bounces, complaints, volume patterns, engagement, and sending history affect it. -Email Service is intended only for transactional emails. We plan to support marketing emails and bulk sender tooling in the future. +Refer to [Deliverability](/email-service/concepts/deliverability/) for related reputation factors. -### Where can I report abuse or spam? +## Avoid marketing email -Report abuse to: abuse@cloudflare.com +No. Email Service supports transactional email only. -Include: +## Report email abuse + +Report email abuse to [mailabuse@cloudflare.com](mailto:mailabuse@cloudflare.com). Include: - Full email headers - Description of the issue - Any relevant account information + +Refer to [Postmaster contact information](/email-service/reference/postmaster/#contact-information) for the canonical address. diff --git a/src/content/docs/email-service/reference/index.mdx b/src/content/docs/email-service/reference/index.mdx index 3ff86e22a32..36a5d1a814b 100644 --- a/src/content/docs/email-service/reference/index.mdx +++ b/src/content/docs/email-service/reference/index.mdx @@ -1,9 +1,9 @@ --- pcx_content_type: navigation title: Reference -description: Email Service reference material including headers, postmaster info, FAQ, and troubleshooting. +description: Find events, headers, postmaster details, FAQs, and troubleshooting. sidebar: - order: 9 + order: 7 group: hideIndex: true products: @@ -12,6 +12,6 @@ products: import { DirectoryListing } from "~/components"; -Reference material for Email Service, including postmaster information, email headers, troubleshooting, and FAQ. +Find Email Service events, headers, postmaster details, FAQs, and troubleshooting. diff --git a/src/content/docs/email-service/reference/troubleshooting.mdx b/src/content/docs/email-service/reference/troubleshooting.mdx index 35d3702b95b..818be94677a 100644 --- a/src/content/docs/email-service/reference/troubleshooting.mdx +++ b/src/content/docs/email-service/reference/troubleshooting.mdx @@ -179,7 +179,7 @@ Example result: This error occurs when passing `ArrayBuffer` content in attachment fields during local development with `wrangler dev`. The local email binding simulator cannot serialize `ArrayBuffer` values. -**Solution:** Deploy your Worker with `npx wrangler deploy` and test binary attachments (images, PDFs) against the deployed version. String content for text-based attachments works normally in local development. Refer to [local development for email sending](/email-service/local-development/sending/#known-limitations) for more details. +**Solution:** Deploy your Worker with `npx wrangler deploy` and test binary attachments (images, PDFs) against the deployed version. String content for text-based attachments works normally in local development. Refer to [local development for email sending](/email-service/observability/local-development/sending/#known-limitations) for more details. ## Common delivery issues