INTEGRITY Cloudflare Docs

Configure send bindings

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.

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.

{
	"send_email": [
		// Send to any verified destination
		{ "name": "EMAIL" },
		// Send only to a single fixed destination
		{
			"name": "NOTIFY_OPS",
			"destination_address": "[email protected]",
		},
		// Send only to addresses on an allowlist
		{
			"name": "EMAIL_TEAM",
			"allowed_destination_addresses": [
				"[email protected]",
				"[email protected]",
			],
		},
		// Send only from addresses on an allowlist
		{
			"name": "RESTRICTED_EMAIL",
			"allowed_sender_addresses": [
				"[email protected]",
				"[email protected]",
			],
		},
	],
}
[[send_email]]
name = "EMAIL"

[[send_email]]
name = "NOTIFY_OPS"
destination_address = "[email protected]"

[[send_email]]
name = "EMAIL_TEAM"
allowed_destination_addresses = [ "[email protected]", "[email protected]" ]

[[send_email]]
name = "RESTRICTED_EMAIL"
allowed_sender_addresses = [ "[email protected]", "[email protected]" ]

Next steps