Send emails from a pages function

Heyo πŸ‘‹ Is it possible to send emails from a pages function? I am trying somewhat along the lines of https://developers.cloudflare.com/email-routing/email-workers/send-email-workers/ but it keeps failing miserably (added context: i am at a point where i would need to link an email binding, but there just is no way to do that apparently)
Send emails from Workers Β· Cloudflare Email Routing docs
You can send an email about your Worker’s activity from your Worker to an email address verified on Email Routing. This is useful for when you want to …
1 Reply
JustinNoel
JustinNoelβ€’14mo ago
Some of the worker capabilities are not available in pages yet. Here are the possible binding options for pages. I don't see anything about emails.
wrangler pages dev [directory] [-- command..]

πŸ§‘β€πŸ’» Develop your full-stack Pages application locally

Positionals:
directory The directory of static assets to serve [string]
command The proxy command to run [string]

Flags:
-j, --experimental-json-config Experimental: Support wrangler.json [boolean]
-e, --env Environment to use for operations and .env files [string]
-h, --help Show help [boolean]
-v, --version Show version number [boolean]

Options:
--compatibility-date Date to use for compatibility checks [string]
--compatibility-flags, --compatibility-flag Flags to use for compatibility checks [array]
--ip The IP address to listen on [string] [default: "0.0.0.0"]
--port The port to listen on (serve from) [number] [default: 8788]
--inspector-port Port for devtools to connect to [number]
--proxy The port to proxy (where the static assets are served) [number]
--script-path The location of the single Worker script if not using functions [string] [default: "_worker.js"]
--no-bundle Whether to run bundling on `_worker.js` [boolean] [default: false]
-b, --binding Bind variable/secret (KEY=VALUE) [array]
-k, --kv KV namespace to bind (--kv KV_BINDING) [array]
--d1 D1 database to bind (--d1 D1_BINDING) [array]
-o, --do Durable Object to bind (--do DO_BINDING=CLASS_NAME@SCRIPT_NAME) [array]
--r2 R2 bucket to bind (--r2 R2_BINDING) [array]
--service Service to bind (--service SERVICE=SCRIPT_NAME) [array]
--live-reload Auto reload HTML pages when change is detected [boolean] [default: false]
--local-protocol Protocol to listen to requests on, defaults to http. [choices: "http", "https"]
--persist-to Specify directory to use for local persistence (defaults to .wrangler/state) [string]
--log-level Specify logging level [choices: "debug", "info", "log", "warn", "error", "none"]
➜ say-my-name git:(dev-switch-to-d1) βœ—
wrangler pages dev [directory] [-- command..]

πŸ§‘β€πŸ’» Develop your full-stack Pages application locally

Positionals:
directory The directory of static assets to serve [string]
command The proxy command to run [string]

Flags:
-j, --experimental-json-config Experimental: Support wrangler.json [boolean]
-e, --env Environment to use for operations and .env files [string]
-h, --help Show help [boolean]
-v, --version Show version number [boolean]

Options:
--compatibility-date Date to use for compatibility checks [string]
--compatibility-flags, --compatibility-flag Flags to use for compatibility checks [array]
--ip The IP address to listen on [string] [default: "0.0.0.0"]
--port The port to listen on (serve from) [number] [default: 8788]
--inspector-port Port for devtools to connect to [number]
--proxy The port to proxy (where the static assets are served) [number]
--script-path The location of the single Worker script if not using functions [string] [default: "_worker.js"]
--no-bundle Whether to run bundling on `_worker.js` [boolean] [default: false]
-b, --binding Bind variable/secret (KEY=VALUE) [array]
-k, --kv KV namespace to bind (--kv KV_BINDING) [array]
--d1 D1 database to bind (--d1 D1_BINDING) [array]
-o, --do Durable Object to bind (--do DO_BINDING=CLASS_NAME@SCRIPT_NAME) [array]
--r2 R2 bucket to bind (--r2 R2_BINDING) [array]
--service Service to bind (--service SERVICE=SCRIPT_NAME) [array]
--live-reload Auto reload HTML pages when change is detected [boolean] [default: false]
--local-protocol Protocol to listen to requests on, defaults to http. [choices: "http", "https"]
--persist-to Specify directory to use for local persistence (defaults to .wrangler/state) [string]
--log-level Specify logging level [choices: "debug", "info", "log", "warn", "error", "none"]
➜ say-my-name git:(dev-switch-to-d1) βœ—
Want results from more Discord servers?
Add your server