diff --git a/src/assets/images/email-service/local-explorer-email-routing-detail.png b/src/assets/images/email-service/local-explorer-email-routing-detail.png new file mode 100644 index 00000000000..8ceeb8d27e1 Binary files /dev/null and b/src/assets/images/email-service/local-explorer-email-routing-detail.png differ diff --git a/src/assets/images/email-service/local-explorer-email-sending-detail.png b/src/assets/images/email-service/local-explorer-email-sending-detail.png new file mode 100644 index 00000000000..c6b6b8cd87c Binary files /dev/null and b/src/assets/images/email-service/local-explorer-email-sending-detail.png differ diff --git a/src/content/changelog/email-service/2026-08-24-local-explorer-email.mdx b/src/content/changelog/email-service/2026-08-24-local-explorer-email.mdx new file mode 100644 index 00000000000..8eb06c22f9c --- /dev/null +++ b/src/content/changelog/email-service/2026-08-24-local-explorer-email.mdx @@ -0,0 +1,21 @@ +--- +title: Inspect Email Workers with Local Explorer +description: Inspect locally routed and sent email, and deliver test messages to Email Workers from Local Explorer. +products: + - workers +date: 2026-08-24 +--- + +Local Explorer now includes **Routing** and **Sending** views for Email Workers during local development. + +The **Routing** view captures messages delivered to an `email()` handler. You can inspect message content, headers, attachments, replies, forwarding, rejection, and other handler activity. The test email composer can deliver custom text, HTML, headers, and attachments directly to the handler. + +![Local Explorer Routing detail showing a received email that was forwarded and replied to](~/assets/images/email-service/local-explorer-email-routing-detail.png) + +The **Sending** view captures messages sent through simulated local `send_email` bindings. You can inspect the recipients, headers, attachments, and body for each message. + +![Local Explorer Sending view showing a sent email list and selected message detail](~/assets/images/email-service/local-explorer-email-sending-detail.png) + +Run `wrangler dev` and press `e` to open Local Explorer. + +For configuration and usage details, refer to the [Local Explorer documentation](/workers/local-development/local-explorer/) and [Email Service local development documentation](/email-service/local-development/). diff --git a/src/content/docs/email-service/local-development/routing.mdx b/src/content/docs/email-service/local-development/routing.mdx index c19f00c9842..e5da9b7ea4d 100644 --- a/src/content/docs/email-service/local-development/routing.mdx +++ b/src/content/docs/email-service/local-development/routing.mdx @@ -70,7 +70,11 @@ Start your development server: npx wrangler dev ``` -Send a test email using the local endpoint. The request body must be a raw email message in [RFC 5322](https://datatracker.ietf.org/doc/html/rfc5322) format, and the message must include a `Message-ID` header: +To test through Local Explorer, press `e` in the `wrangler dev` terminal. In Local Explorer, go to **Email** > **Routing** and select **Send Test Email**. Compose the message, then select **Send Email**. Local Explorer delivers the message to the selected Worker `email()` handler. + +The **Routing** view lists messages delivered during the local session. Select a message to inspect its headers, body, attachments, and handler actions. + +You can also send a test email using the local endpoint. The request body must be a raw email message in [RFC 5322](https://datatracker.ietf.org/doc/html/rfc5322) format, and the message must include a `Message-ID` header: ```bash curl --request POST 'http://localhost:8787/cdn-cgi/local/email' \ diff --git a/src/content/docs/email-service/local-development/sending.mdx b/src/content/docs/email-service/local-development/sending.mdx index 28b254c6a53..648bf3fe3fb 100644 --- a/src/content/docs/email-service/local-development/sending.mdx +++ b/src/content/docs/email-service/local-development/sending.mdx @@ -70,6 +70,8 @@ Remote bindings send real emails to real recipients. Use test email addresses to When running `wrangler dev` without remote bindings, the email binding is simulated locally. Emails are not sent -- instead, the email content is logged to the console and saved to local files for inspection. +Local Explorer also captures these messages. Press `e` in the `wrangler dev` terminal, then go to **Email** > **Sending**. Select a message to inspect its recipients, headers, attachments, and captured body. + ## Basic sending worker ```javascript diff --git a/src/content/docs/workers/local-development/local-explorer.mdx b/src/content/docs/workers/local-development/local-explorer.mdx index 7f55f3e165b..c0be1bce70e 100644 --- a/src/content/docs/workers/local-development/local-explorer.mdx +++ b/src/content/docs/workers/local-development/local-explorer.mdx @@ -45,12 +45,21 @@ Local Explorer supports the following binding types: | [R2](/r2/) | List objects, view metadata | Upload and delete objects | | [D1](/d1/) | Browse tables and rows, run SQL queries | Insert, update, and delete rows through SQL | | [Durable Objects](/durable-objects/) (SQLite storage) | Browse SQLite tables and rows, run SQL queries | Insert, update, and delete rows through SQL | +| [Email Service](/email-service/) | Inspect locally routed and sent email | Send test messages to `email()` handlers | | [Workflows](/workflows/) | List instances, view status and step history | Trigger new runs, retry failed instances | ### D1 and Durable Objects SQL Studio For [D1](/d1/) databases and [Durable Objects](/durable-objects/) that use the [SQLite storage API](/durable-objects/api/sqlite-storage-api/), Local Explorer includes a SQL Studio. This is the same experience available in the Cloudflare dashboard for deployed D1 databases. It provides both a visual table browser with inline editing and a SQL query editor where you can run arbitrary queries. +### Email Service + +Local Explorer captures email activity during local development. The **Routing** view lists messages delivered to the `email()` handler. Select a message to inspect its headers, body, attachments, and handler actions. You can also compose a test message and deliver it to the handler. + +The **Sending** view lists messages sent through local [`send_email` bindings](/email-service/api/send-emails/workers-api/). Select a message to inspect its recipients, headers, attachments, and captured body. + +For configuration and testing examples, refer to [Email routing local development](/email-service/local-development/routing/) and [Email sending local development](/email-service/local-development/sending/). + ## Observability Local Explorer automatically captures traces and logs from every Worker invocation during `wrangler dev` without modifying your code. You get the same instrumentation as production [Workers Logs](/workers/observability/logs/workers-logs/) and [Traces](/workers/observability/traces/), including invocation logs, binding operations, timing, and console output, directly in your browser during development.