You can now manage your email routing entirely from Wrangler!
Hey there, it's Shii-chan! Today I want to share a small but handy update I found on the Cloudflare Changelog.
Cloudflare ChangelogWhat was announced?
On the Cloudflare Changelog, there's an announcement that you can now manage the Email Routing rules that route email to a Worker directly from your Wrangler configuration. Just add a top-level addresses field with literal email addresses or a catch-all address, and it gets applied as a routing rule.
The story so far
Until now, even though you could manage a Worker's own code and settings through Wrangler, the Email Routing rules deciding which address routes mail to that Worker had to be managed somewhere else. When a Worker's code and the trigger configuration that invokes it live in different places, it's easy to lose track of changes or forget to keep them in sync on every deploy.
What changes
Email Routing rules can now be version-controlled inside the same config file as the Worker's code and its compatibility_date. Running wrangler deploy alone can now roll the mail routing setup into the deployment too, which is a nice convenience.
Dive Deep
Here's what the config looks like:
{
"$schema": "./node_modules/wrangler/config-schema.json",
"name": "invoice-handler",
"main": "src/index.ts",
"compatibility_date": "2026-09-25",
"addresses": ["invoice@yourdomain.com"]
}
The addresses field accepts literal email addresses as well as a catch-all address. In TOML, it looks like this:
name = "invoice-handler"
main = "src/index.ts"
compatibility_date = "2026-09-25"
addresses = ["invoice@yourdomain.com"]
When you run wrangler deploy, it automatically:
- Creates rules for addresses newly added to the config
- Updates rules that Wrangler already manages
- Removes rules Wrangler manages that are no longer in the config
And before it makes a potentially destructive change, like removing a rule, Wrangler shows you the planned changes and asks for confirmation. That should help prevent accidentally wiping out an important routing rule.
Rules created by Wrangler also show up in the dashboard, but with a dedicated icon that marks them as Wrangler-managed, so they're easy to tell apart from rules you created manually there.
Wrap-up
- Email Routing rules can now be managed from Wrangler's config file via the
addressesfield wrangler deploycreates, updates, and removes rules together- Destructive changes like deletions require confirmation first
- Wrangler-managed rules are marked with an icon in the dashboard too
If you want to manage a Worker with Email Routing entirely as code, this is a quietly satisfying update!