Cloudflare Email Service for Openclaw

A comprehensive developer guide and AI skill for configuring, sending, and routing transactional emails seamlessly using Cloudflare Email Service.

creativerezz
v1.0.0
Jun 11, 2026
0
511
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install cloudflare-email-service

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install cloudflare-email-service using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Cloudflare Email Service?

Cloudflare Email Service allows developers to send transactional emails and route incoming messages directly inside the Cloudflare ecosystem. It represents a modern, serverless approach to email, bypassing the need for third-party email APIs and complex SMTP setups. By utilizing this specialized resource within Openclaw Skills, developers and AI coding agents can quickly configure domain authentication, implement Workers bindings, and manage routing policies with zero-key authentication setups.

This skill is crucial because it accounts for the latest 2025 platform features, CLI commands, and library type definitions. Whether you are sending automated alerts from a worker, deploying AI agents that respond to user emails, or parsing incoming MIME streams, this documentation ensures your implementations adhere to Cloudflare best practices and avoid common delivery pitfalls.

Cloudflare Email Service Use Cases

  • Sending transactional emails directly from Cloudflare Workers without managing external API keys.
  • Building responsive AI agents with the Cloudflare Agents SDK using email-based interaction patterns.
  • Routing, forwarding, and processing inbound emails programmatically via the Workers email handler.
  • Dispatching emails from external microservices (Node.js, Go, Python) using the Cloudflare REST API.
  • Configuring high-deliverability email domains using automated Wrangler CLI commands and DNS setup.

How Cloudflare Email Service Works

  1. Domain Verification: Onboard and verify your custom email domain with Cloudflare using the Wrangler CLI or Dashboard to enable sending privileges.
  2. Binding & Configuration: Configure the send_email binding in your wrangler.jsonc file, exposing the secure env.EMAIL interface inside your environment.
  3. Email Dispatching: Invoke env.EMAIL.send() within your code, or run a REST request to dispatch transactional emails with HTML and plaintext payloads.
  4. Inbound Routing: Intercept incoming emails using the Worker email() handler, parsing raw MIME streams with libraries like postal-mime to execute custom routing logic.
  5. Deliverability Optimization: Enforce DKIM, SPF, and DMARC settings to secure your sending domain against spoofing and ensure optimal inbox placement.

Cloudflare Email Service Setup

To start sending emails, first install Wrangler and verify your domain. Run the following command to check your verified domains:

npx wrangler email sending list

If your domain is not listed, enable email sending capability by executing:

npx wrangler email sending enable yourdomain.com

Next, add the email binding to your wrangler.jsonc configuration file:

{
  "send_email": [
    {
      "name": "EMAIL"
    }
  ]
}

Finally, implement the worker code to send an email using the established binding:

const response = await env.EMAIL.send({
  to: "[email protected]",
  from: { email: "[email protected]", name: "App Alerts" },
  subject: "Hello from Cloudflare!",
  html: "<h1>Your message has arrived</h1>",
  text: "Your message has arrived."
});

Cloudflare Email Service Data Schema & Taxonomy

Cloudflare Email Service organizes its data and payloads depending on the selected interface (Workers Binding vs. REST API). Integrating these data specifications into Openclaw Skills helps developers minimize runtime schema errors.

Workers Binding Payload Structure

Property Type Description Required
to string | string[] Single recipient email address or array of recipient addresses Yes
from object Sender details containing email (string) and optional name (string) Yes
subject string The email subject line Yes
html string The HTML body content No
text string The plaintext fallback body Yes (Recommended)

REST API Payload Structure

Unlike the Workers binding, the REST API requires snake_case parameters and a slightly modified from schema:

  • Endpoint: POST https://api.cloudflare.com/client/v4/accounts/{account_id}/email/sending/send
  • Sender Object: Uses { "address": "[email protected]", "name": "Sender" } instead of the email key.
  • Reply To: Uses reply_to (snake_case) rather than replyTo.

Cloudflare Email Service Advanced Features

  • Agents SDK Integration: Wire email hooks directly to intelligent agents using the onEmail() and replyToEmail() helper methods.
  • MIME Stream Handling: Process incoming raw emails via message.raw streams, transforming them into parsed objects with the postal-mime package.
  • Custom Header Injection: Define customized SMTP headers on outgoing transactions to enable tracking and custom category grouping.
  • Wrangler CLI Management: Use powerful CLI capabilities to manage routing rules, verify physical destination addresses, and diagnose domain delivery status.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*