WIP: rewrite email-agent for Cloudflare Email Service#1279
Draft
whoiskatrin wants to merge 3 commits intomainfrom
Draft
WIP: rewrite email-agent for Cloudflare Email Service#1279whoiskatrin wants to merge 3 commits intomainfrom
whoiskatrin wants to merge 3 commits intomainfrom
Conversation
Replace the worker-only email routing demo with a full-stack app that shows outbound sends, inbound routing, and synced mailbox state. Update the docs to reflect Email Service terminology and setup.
🦋 Changeset detectedLatest commit: b34fc73 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Replace the concrete inboxbuddy.dev mailbox in the email-agent example with a neutral example address. This keeps the sample configuration and docs from pointing at a specific mailbox.
agents
@cloudflare/ai-chat
@cloudflare/codemode
hono-agents
@cloudflare/shell
@cloudflare/think
@cloudflare/voice
@cloudflare/worker-bundler
commit: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR rewrites the
examples/email-agentexample around Cloudflare Email Service instead of the older worker-only email routing flow. It turns the example into a full-stack app with a React UI, outbound email sending through the Workers Email binding, inbound routing into an agent, and synced mailbox state that makes the end-to-end flow easier to understand and demo.What Changed
examples/email-agentimplementation with a full-stack Vite + React example.src/server.tsand addsrc/client.tsx,src/styles.css,index.html,vite.config.ts, and a small public favicon.env.EMAIL.send()for outbound email and keeprouteAgentEmail()for inbound delivery into the agent.postal-mime, store recent mailbox activity in agent state, and optionally useEMAIL_SECRETfor signed replies viareplyToEmail().docs/email.md,docs/agent-class.md,docs/getting-started.md,docs/index.md, and the rootREADME.mdto use Cloudflare Email Service terminology and setup guidance.mailbox-7f3a@example.comin config, generated types, UI defaults, and docs.Why
The previous example showed only part of the email story and still used older Email Routing language. This rewrite makes the example line up with the current Cloudflare Email Service model, gives users a runnable full-stack demo, and documents the exact pieces needed for both outbound sends and inbound agent routing.
Validation
npm run check.npm run checkdid not complete cleanly because of existing repo-level warnings fromsherifand becauseoxfmt --checkpicked up an untracked local.tmp-playwright-report/directory that is not part of this PR.Reviewer Notes
EMAIL_FROMbeing a verified sender address in Cloudflare Email Service.EMAIL_SECRETis optional. Without it, the example still works, but follow-up replies fall back to address-based routing instead of signed secure reply routing./api/simulate-emailendpoint is only a development helper to exercise the inbound path before real routing is configured.Reviewers