[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7AK0RQPR64K2RTM5H9T4V13":3,"skill-same:01M7AK0RQPR64K2RTM5H9T4V13":59},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":24,"commitSha":25,"skillDirectory":5,"forksCount":13,"repositoryHtmlUrl":26,"repositoryHomepageUrl":6,"ownerHtmlUrl":27,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":28,"install":29,"resources":42},"01M7AK0RQPR64K2RTM5H9T4V13","cloudflare-email-routing",null,"Complete guide for Cloudflare Email Routing covering both Email Workers (receiving emails) and Send Email bindings (sending emails from Workers).\n\nUse when: setting up email routing, creating email workers, processing incoming emails, sending emails from Workers, implementing email allowlists\u002Fblocklists, forwarding emails with custom logic, replying to emails automatically, parsing email content, configuring MX records for email, troubleshooting email delivery issues, or encountering email worker errors.\n\nPrevents 8 documented issues: \"Email Trigger not available\" errors, destination address verification bugs, Gmail rate limiting, SPF permerror issues, worker call failures, test event loading issues, activity log discrepancies, and limited debugging on free plans.\n\nKeywords: Cloudflare Email Routing, Email Workers, send email, receive email, email forwarding, email allowlist, email blocklist, postal-mime, mimetext, cloudflare:email, EmailMessage, ForwardableEmailMessage, EmailEvent, MX records, SPF, DKIM, email worker binding, send_email binding, wrangler email, email handler, email routing worker, \"Email Trigger not available\", \"failed to call worker\", email delivery failed, email not forwarding, destination address not verified","davidanthonyn\u002Fclaude-skills","davidanthonyn","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F55152980?v=4","01M7AJ4MY8S5C2RJCGX6626J0G","01M7AJ7JE1K98GRPH9Z57Z0R0W",0,"MIT","https:\u002F\u002Fgithub.com\u002Fdavidanthonyn\u002Fclaude-skills\u002Fblob\u002Fmain\u002Fcloudflare-email-routing\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: cloudflare-email-routing\ndescription: |\n  Complete guide for Cloudflare Email Routing covering both Email Workers (receiving emails) and Send Email bindings (sending emails from Workers).\n\n  Use when: setting up email routing, creating email workers, processing incoming emails, sending emails from Workers, implementing email allowlists\u002Fblocklists, forwarding emails with custom logic, replying to emails automatically, parsing email content, configuring MX records for email, troubleshooting email delivery issues, or encountering email worker errors.\n\n  Prevents 8 documented issues: \"Email Trigger not available\" errors, destination address verification bugs, Gmail rate limiting, SPF permerror issues, worker call failures, test event loading issues, activity log discrepancies, and limited debugging on free plans.\n\n  Keywords: Cloudflare Email Routing, Email Workers, send email, receive email, email forwarding, email allowlist, email blocklist, postal-mime, mimetext, cloudflare:email, EmailMessage, ForwardableEmailMessage, EmailEvent, MX records, SPF, DKIM, email worker binding, send_email binding, wrangler email, email handler, email routing worker, \"Email Trigger not available\", \"failed to call worker\", email delivery failed, email not forwarding, destination address not verified\nlicense: MIT\n---\n\n# Cloudflare Email Routing\n\n**Status**: Production Ready ✅\n**Last Updated**: 2025-10-23\n**Latest Versions**: postal-mime@2.5.0, mimetext@3.0.27\n\n---\n\n## What is Cloudflare Email Routing?\n\nCloudflare Email Routing provides two complementary capabilities:\n\n1. **Email Workers** - Receive and process incoming emails with custom logic (allowlists, blocklists, forwarding, parsing, replying)\n2. **Send Email** - Send emails from Workers to verified destination addresses (notifications, alerts, confirmations)\n\nBoth capabilities are **free** and work together to enable complete email functionality in Cloudflare Workers.\n\n---\n\n## Quick Start (10 Minutes)\n\n### Part 1: Enable Email Routing (Dashboard)\n\n**Prerequisites**: Domain must be on Cloudflare DNS\n\n1. Log in to Cloudflare Dashboard → select your domain\n2. Go to **Email** > **Email Routing**\n3. Select **Enable Email Routing** → **Add records and enable**\n   - This automatically adds MX records, SPF, and DKIM to your DNS\n4. Create a destination address:\n   - **Custom address**: `hello@yourdomain.com`\n   - **Destination**: Your personal email (e.g., `you@gmail.com`)\n   - **Verify** the destination address via email\n5. ✅ Basic email forwarding is now active\n\n**What you just did**: Configured DNS and basic forwarding. Now let's add Workers for custom logic.\n\n---\n\n### Part 2: Receiving Emails with Email Workers\n\n#### 1. Install Dependencies\n\n```bash\nnpm install postal-mime@2.5.0 mimetext@3.0.27\n```\n\n**Why these packages:**\n- `postal-mime` - Parse incoming email messages (headers, body, attachments)\n- `mimetext` - Create email messages for sending\u002Freplying\n\n#### 2. Create Email Worker\n\nCreate `src\u002Femail.ts`:\n\n```typescript\nimport { EmailMessage } from 'cloudflare:email';\nimport PostalMime from 'postal-mime';\n\nexport default {\n  async email(message, env, ctx) {\n    \u002F\u002F Parse the incoming message\n    const parser = new PostalMime.default();\n    const email = await parser.parse(await new Response(message.raw).arrayBuffer());\n\n    console.log('From:', message.from);\n    console.log('To:', message.to);\n    console.log('Subject:', email.subject);\n\n    \u002F\u002F Forward to verified destination\n    await message.forward('your-email@example.com');\n  },\n};\n```\n\n#### 3. Configure Wrangler\n\nUpdate `wrangler.jsonc`:\n\n```jsonc\n{\n  \"name\": \"email-worker\",\n  \"main\": \"src\u002Femail.ts\",\n  \"compatibility_date\": \"2025-10-11\"\n}\n```\n\n#### 4. Deploy and Bind\n\n```bash\nnpx wrangler deploy\n\n# In Cloudflare Dashboard:\n# Email > Email Routing > Email Workers\n# Select your worker → Create route → Enter address (e.g., hello@yourdomain.com)\n```\n\n**What you just did**: Created a Worker that logs and forwards emails.\n\n---\n\n### Part 3: Sending Emails from Workers\n\n#### 1. Configure Send Email Binding\n\nUpdate `wrangler.jsonc`:\n\n```jsonc\n{\n  \"name\": \"my-worker\",\n  \"main\": \"src\u002Findex.ts\",\n  \"compatibility_date\": \"2025-10-11\",\n  \"send_email\": [\n    {\n      \"name\": \"EMAIL\",\n      \"destination_address\": \"notifications@yourdomain.com\"\n    }\n  ]\n}\n```\n\n**CRITICAL**: `destination_address` must be:\n- A domain where you have Email Routing enabled\n- A verified destination address in Email Routing settings\n\n#### 2. Send Email from Worker\n\n```typescript\nimport { EmailMessage } from 'cloudflare:email';\nimport { createMimeMessage } from 'mimetext';\n\nexport default {\n  async fetch(request, env, ctx) {\n    \u002F\u002F Create email message\n    const msg = createMimeMessage();\n    msg.setSender({ name: 'My App', addr: 'noreply@yourdomain.com' });\n    msg.setRecipient('user@example.com');\n    msg.setSubject('Welcome to My App');\n    msg.addMessage({\n      contentType: 'text\u002Fplain',\n      data: 'Thank you for signing up!',\n    });\n\n    \u002F\u002F Send via binding\n    const message = new EmailMessage(\n      'noreply@yourdomain.com',\n      'user@example.com',\n      msg.asRaw()\n    );\n\n    await env.EMAIL.send(message);\n\n    return new Response('Email sent!');\n  },\n};\n```\n\n#### 3. Deploy\n\n```bash\nnpx wrangler deploy\n```\n\n**What you just did**: Configured your Worker to send emails to verified addresses.\n\n---\n\n## Email Workers: Complete Guide\n\n### Runtime API\n\n#### EmailEvent Handler\n\n```typescript\nexport default {\n  async email(message: ForwardableEmailMessage, env: Env, ctx: ExecutionContext) {\n    \u002F\u002F Process email here\n  },\n};\n```\n\n**Parameters:**\n- `message` - ForwardableEmailMessage object\n- `env` - Environment bindings (KV, D1, secrets, etc.)\n- `ctx` - Execution context (waitUntil for async operations)\n\n#### ForwardableEmailMessage Properties\n\n```typescript\ninterface ForwardableEmailMessage {\n  readonly from: string;          \u002F\u002F Sender email\n  readonly to: string;            \u002F\u002F Recipient email\n  readonly headers: Headers;      \u002F\u002F Email headers\n  readonly raw: ReadableStream;   \u002F\u002F Raw email message\n  readonly rawSize: number;       \u002F\u002F Size in bytes\n\n  \u002F\u002F Methods\n  setReject(reason: string): void;\n  forward(rcptTo: string, headers?: Headers): Promise\u003Cvoid>;\n  reply(message: EmailMessage): Promise\u003Cvoid>;\n}\n```\n\n---\n\n## Common Patterns\n\n### Pattern 1: Allowlist\n\nOnly accept emails from approved senders:\n\n```typescript\nexport default {\n  async email(message, env, ctx) {\n    const allowList = [\n      'friend@example.com',\n      'coworker@company.com',\n      'support@vendor.com',\n    ];\n\n    if (!allowList.includes(message.from)) {\n      message.setReject('Address not on allowlist');\n      return;\n    }\n\n    await message.forward('inbox@yourdomain.com');\n  },\n};\n```\n\n**When to use**: Contact forms, private email addresses, team inboxes\n\n---\n\n### Pattern 2: Blocklist\n\nReject emails from specific senders or domains:\n\n```typescript\nexport default {\n  async email(message, env, ctx) {\n    const blockList = [\n      'spam@badactor.com',\n      '@suspicious-domain.com', \u002F\u002F Block entire domain\n    ];\n\n    const isBlocked = blockList.some(pattern =>\n      message.from.includes(pattern)\n    );\n\n    if (isBlocked) {\n      message.setReject('Sender blocked');\n      return;\n    }\n\n    await message.forward('inbox@yourdomain.com');\n  },\n};\n```\n\n**When to use**: Spam filtering, blocking harassers, domain-level blocks\n\n---\n\n### Pattern 3: Parse and Store\n\nExtract email content and store in D1 or KV:\n\n```typescript\nimport PostalMime from 'postal-mime';\n\nexport default {\n  async email(message, env, ctx) {\n    \u002F\u002F Parse email\n    const parser = new PostalMime.default();\n    const rawEmail = new Response(message.raw);\n    const email = await parser.parse(await rawEmail.arrayBuffer());\n\n    \u002F\u002F Store in D1\n    await env.DB.prepare(\n      'INSERT INTO emails (from_addr, subject, text, received_at) VALUES (?, ?, ?, ?)'\n    ).bind(\n      message.from,\n      email.subject,\n      email.text,\n      new Date().toISOString()\n    ).run();\n\n    \u002F\u002F Forward to inbox\n    await message.forward('inbox@yourdomain.com');\n  },\n};\n```\n\n**When to use**: Email archiving, ticket systems, support inboxes, audit logs\n\n---\n\n### Pattern 4: Auto-Reply\n\nSend automatic replies with custom logic:\n\n```typescript\nimport PostalMime from 'postal-mime';\nimport { createMimeMessage } from 'mimetext';\nimport { EmailMessage } from 'cloudflare:email';\n\nexport default {\n  async email(message, env, ctx) {\n    \u002F\u002F Parse incoming email\n    const parser = new PostalMime.default();\n    const email = await parser.parse(await new Response(message.raw).arrayBuffer());\n\n    \u002F\u002F Create reply\n    const msg = createMimeMessage();\n    msg.setSender({ name: 'Support Team', addr: 'support@yourdomain.com' });\n    msg.setRecipient(message.from);\n    msg.setHeader('In-Reply-To', message.headers.get('Message-ID'));\n    msg.setSubject(`Re: ${email.subject}`);\n    msg.addMessage({\n      contentType: 'text\u002Fplain',\n      data: `Thank you for your message about \"${email.subject}\". We'll respond within 24 hours.`,\n    });\n\n    \u002F\u002F Send reply\n    const replyMessage = new EmailMessage(\n      'support@yourdomain.com',\n      message.from,\n      msg.asRaw()\n    );\n\n    await message.reply(replyMessage);\n\n    \u002F\u002F Also forward to team inbox\n    await message.forward('team@yourdomain.com');\n  },\n};\n```\n\n**When to use**: Out-of-office replies, support ticket acknowledgments, automated responses\n\n---\n\n### Pattern 5: Conditional Routing\n\nRoute emails to different destinations based on content:\n\n```typescript\nimport PostalMime from 'postal-mime';\n\nexport default {\n  async email(message, env, ctx) {\n    const parser = new PostalMime.default();\n    const email = await parser.parse(await new Response(message.raw).arrayBuffer());\n\n    const subject = email.subject.toLowerCase();\n\n    \u002F\u002F Route based on subject keywords\n    if (subject.includes('urgent') || subject.includes('critical')) {\n      await message.forward('oncall@yourdomain.com');\n    } else if (subject.includes('invoice') || subject.includes('payment')) {\n      await message.forward('billing@yourdomain.com');\n    } else if (subject.includes('support') || subject.includes('help')) {\n      await message.forward('support@yourdomain.com');\n    } else {\n      await message.forward('inbox@yourdomain.com');\n    }\n  },\n};\n```\n\n**When to use**: Department routing, priority filtering, category-based inboxes\n\n---\n\n## Send Email: Complete Guide\n\n### Configuration\n\n#### Single Destination (Simple)\n\n```jsonc\n{\n  \"send_email\": [\n    {\n      \"name\": \"EMAIL\",\n      \"destination_address\": \"notifications@yourdomain.com\"\n    }\n  ]\n}\n```\n\n**Behavior**: All emails sent via `env.EMAIL` go to this address.\n\n#### Multiple Destinations (Flexible)\n\n```jsonc\n{\n  \"send_email\": [\n    {\n      \"name\": \"EMAIL\",\n      \"allowed_destination_addresses\": [\n        \"notifications@yourdomain.com\",\n        \"alerts@yourdomain.com\",\n        \"user@gmail.com\"\n      ]\n    }\n  ]\n}\n```\n\n**Behavior**: Can send to any address in the list.\n\n#### Multiple Bindings (Organized)\n\n```jsonc\n{\n  \"send_email\": [\n    {\n      \"name\": \"NOTIFICATIONS\",\n      \"destination_address\": \"notifications@yourdomain.com\"\n    },\n    {\n      \"name\": \"ALERTS\",\n      \"destination_address\": \"alerts@yourdomain.com\"\n    }\n  ]\n}\n```\n\n**Behavior**: Use different bindings for different purposes.\n\n---\n\n### Sending Emails\n\n#### Basic Text Email\n\n```typescript\nimport { EmailMessage } from 'cloudflare:email';\nimport { createMimeMessage } from 'mimetext';\n\nconst msg = createMimeMessage();\nmsg.setSender({ name: 'My App', addr: 'noreply@yourdomain.com' });\nmsg.setRecipient('user@example.com');\nmsg.setSubject('Welcome!');\nmsg.addMessage({\n  contentType: 'text\u002Fplain',\n  data: 'Welcome to our service!',\n});\n\nconst email = new EmailMessage(\n  'noreply@yourdomain.com',\n  'user@example.com',\n  msg.asRaw()\n);\n\nawait env.EMAIL.send(email);\n```\n\n#### HTML Email\n\n```typescript\nimport { EmailMessage } from 'cloudflare:email';\nimport { createMimeMessage } from 'mimetext';\n\nconst msg = createMimeMessage();\nmsg.setSender({ name: 'My App', addr: 'noreply@yourdomain.com' });\nmsg.setRecipient('user@example.com');\nmsg.setSubject('Welcome!');\n\n\u002F\u002F Add both plain text and HTML versions\nmsg.addMessage({\n  contentType: 'text\u002Fplain',\n  data: 'Welcome to our service!',\n});\n\nmsg.addMessage({\n  contentType: 'text\u002Fhtml',\n  data: '\u003Ch1>Welcome!\u003C\u002Fh1>\u003Cp>Thanks for joining us.\u003C\u002Fp>',\n});\n\nconst email = new EmailMessage(\n  'noreply@yourdomain.com',\n  'user@example.com',\n  msg.asRaw()\n);\n\nawait env.EMAIL.send(email);\n```\n\n#### Email with Custom Headers\n\n```typescript\nimport { EmailMessage } from 'cloudflare:email';\nimport { createMimeMessage } from 'mimetext';\n\nconst msg = createMimeMessage();\nmsg.setSender({ name: 'My App', addr: 'noreply@yourdomain.com' });\nmsg.setRecipient('user@example.com');\nmsg.setSubject('Password Reset');\n\n\u002F\u002F Add custom headers\nmsg.setHeader('X-Priority', '1');\nmsg.setHeader('X-Application-ID', 'my-app-123');\n\nmsg.addMessage({\n  contentType: 'text\u002Fplain',\n  data: 'Click here to reset your password...',\n});\n\nconst email = new EmailMessage(\n  'noreply@yourdomain.com',\n  'user@example.com',\n  msg.asRaw()\n);\n\nawait env.EMAIL.send(email);\n```\n\n---\n\n## DNS Configuration\n\n### Automatic Setup (Recommended)\n\nWhen you enable Email Routing in the dashboard, Cloudflare automatically adds:\n\n1. **MX Records** - Direct email to Cloudflare's servers\n   ```\n   yourdomain.com. 300 IN MX 13 amir.mx.cloudflare.net.\n   yourdomain.com. 300 IN MX 86 linda.mx.cloudflare.net.\n   yourdomain.com. 300 IN MX 24 isaac.mx.cloudflare.net.\n   ```\n\n2. **SPF Record** - Authorize Cloudflare to send on your behalf\n   ```\n   yourdomain.com. 300 IN TXT \"v=spf1 include:_spf.mx.cloudflare.net ~all\"\n   ```\n\n3. **DKIM Records** - Sign outgoing emails\n   ```\n   Automatically configured per domain\n   ```\n\n### Manual Setup (Advanced)\n\nIf you need to migrate from another provider:\n\n1. Go to **Email > Email Routing > Settings**\n2. Select **Start disabling > Unlock records and continue**\n3. Edit DNS records as needed\n4. When ready, **Lock DNS records** to protect Email Routing\n\n**WARNING**: Changing MX records will break Email Routing. Only do this if migrating providers.\n\n---\n\n## Known Issues Prevention\n\nThis skill prevents **8 documented issues**:\n\n### Issue #1: \"Email Trigger not available to this workers\"\n\n**Error**: Testing email workers fails with \"Email Trigger not available to this workers\"\n\n**Source**: [workers-sdk #3751](https:\u002F\u002Fgithub.com\u002Fcloudflare\u002Fworkers-sdk\u002Fissues\u002F3751)\n\n**Why It Happens**: Wrangler dev doesn't fully support email triggers; testing must be done via deployed Workers\n\n**Prevention**:\n- Always deploy email workers before testing\n- Use `wrangler tail` for live debugging\n- Use dashboard \"Test Email Event\" feature (when working)\n\n---\n\n### Issue #2: Destination Address Verification Bug\n\n**Error**: Verified destination addresses show as \"unverified\" in Email Worker forwarding\n\n**Source**: Community reports ([Cloudflare Community](https:\u002F\u002Fcommunity.cloudflare.com\u002Ft\u002Femail-worker-free-reliability\u002F486680))\n\n**Why It Happens**: Bug in dashboard where addresses only show verified if also used in regular routing rules\n\n**Prevention**:\n- Create a regular forward rule for each destination address first\n- Then use the same addresses in Email Workers\n- Verify addresses before deploying workers\n\n---\n\n### Issue #3: Gmail Rate Limiting\n\n**Error**: \"421: Our system has detected an unusual rate of unsolicited mail originating from your IP address\"\n\n**Source**: Community reports\n\n**Why It Happens**: Gmail may flag Cloudflare's IP ranges as suspicious due to shared infrastructure\n\n**Prevention**:\n- Implement proper SPF\u002FDKIM\u002FDMARC records\n- Don't send bulk emails through Email Routing\n- Use transactional email services (e.g., SendGrid, Mailgun) for high volume\n- Rate-limit your sending (max 50-100 emails\u002Fhour for personal use)\n\n---\n\n### Issue #4: SPF Permerror with MailChannels\n\n**Error**: SPF permerror when routing through MailChannels\n\n**Source**: [Community discussion](https:\u002F\u002Fcommunity.cloudflare.com\u002Ft\u002Fworker-mailchannels-email-routing-spf-permerror\u002F637766)\n\n**Why It Happens**: SPF record chain breaks when forwarding through multiple services\n\n**Prevention**:\n- Use Email Routing's native send capabilities instead of MailChannels\n- If using MailChannels, configure SPF includes correctly\n- Test with [MXToolbox SPF checker](https:\u002F\u002Fmxtoolbox.com\u002Fspf.aspx)\n\n---\n\n### Issue #5: Limited Logging on Free Plan\n\n**Error**: Cannot see worker logs or email processing details\n\n**Source**: Community reports\n\n**Why It Happens**: Free plan has limited log retention and streaming\n\n**Prevention**:\n- Use `wrangler tail` during development for live logs\n- Use `console.log()` extensively in email workers\n- Store critical data in D1\u002FKV for debugging\n- Upgrade to Workers Paid plan for better observability\n\n---\n\n### Issue #6: Activity Log Discrepancies\n\n**Error**: Emails show as \"Dropped\" in Activity Log even when successfully forwarded\n\n**Source**: Community reports\n\n**Why It Happens**: Dashboard bug showing incorrect status\n\n**Prevention**:\n- Check actual email delivery instead of relying on dashboard\n- Use `wrangler tail` to verify processing\n- Implement your own logging in D1\u002FKV\n- Test with real emails to confirm delivery\n\n---\n\n### Issue #7: Test Email Event Loading Indefinitely\n\n**Error**: Dashboard \"Test Email Event\" button remains in loading state forever\n\n**Source**: [workers-sdk #9195](https:\u002F\u002Fgithub.com\u002Fcloudflare\u002Fworkers-sdk\u002Fissues\u002F9195)\n\n**Why It Happens**: Bug in dashboard testing interface (unresolved as of 2025-10)\n\n**Prevention**:\n- Don't rely on dashboard testing feature\n- Use `curl` with local development instead (see Local Development section)\n- Deploy and test with real emails\n- Use `wrangler tail` to monitor processing\n\n---\n\n### Issue #8: Worker Call Failures\n\n**Error**: \"Rejected reason: Unknown error: failed to call worker: Worker call failed for 3 times, aborting…\"\n\n**Source**: [workers-sdk #9069](https:\u002F\u002Fgithub.com\u002Fcloudflare\u002Fworkers-sdk\u002Fissues\u002F9069), Community reports\n\n**Why It Happens**: Worker crashes due to runtime errors, timeouts, or memory issues\n\n**Prevention**:\n- Add comprehensive error handling with try\u002Fcatch\n- Set timeouts for external API calls\n- Log errors to D1\u002FKV before rejecting\n- Use `ctx.waitUntil()` for non-critical operations\n- Test with various email formats (plain text, HTML, attachments)\n\n---\n\n## Local Development\n\n### Receiving Emails\n\nWrangler simulates email reception via HTTP POST:\n\n```bash\n# Start dev server\nnpx wrangler dev\n\n# In another terminal, send test email\ncurl http:\u002F\u002Flocalhost:8787 -X POST \\\n  --data-binary @- \u003C\u003C EOF\nFrom: sender@example.com\nTo: recipient@yourdomain.com\nSubject: Test Email\n\nThis is a test email body.\nEOF\n```\n\n**What happens**: Wrangler logs the email processing and shows where forwarded emails would go.\n\n### Sending Emails\n\nWrangler writes sent emails to local .eml files:\n\n```typescript\n\u002F\u002F Your worker code\nawait env.EMAIL.send(message);\n```\n\n**Output in terminal**:\n```\n[wrangler:inf] send_email binding called with the following message:\n  \u002Ftmp\u002Fminiflare-abc123\u002Ffiles\u002Femail\u002Fmessage-123.eml\n```\n\n**View the email**:\n```bash\ncat \u002Ftmp\u002Fminiflare-abc123\u002Ffiles\u002Femail\u002Fmessage-123.eml\n```\n\n---\n\n## Configuration Files Reference\n\n### Complete wrangler.jsonc (Both Receive + Send)\n\n```jsonc\n{\n  \"$schema\": \"node_modules\u002Fwrangler\u002Fconfig-schema.json\",\n  \"name\": \"email-worker\",\n  \"main\": \"src\u002Femail.ts\",\n  \"account_id\": \"YOUR_ACCOUNT_ID\",\n  \"compatibility_date\": \"2025-10-11\",\n  \"observability\": {\n    \"enabled\": true\n  },\n\n  \u002F\u002F Send email binding\n  \"send_email\": [\n    {\n      \"name\": \"NOTIFICATIONS\",\n      \"destination_address\": \"notifications@yourdomain.com\"\n    },\n    {\n      \"name\": \"ALERTS\",\n      \"allowed_destination_addresses\": [\n        \"alerts@yourdomain.com\",\n        \"admin@yourdomain.com\"\n      ]\n    }\n  ],\n\n  \u002F\u002F Optional: Add other bindings\n  \"d1_databases\": [\n    {\n      \"binding\": \"DB\",\n      \"database_name\": \"email-archive\",\n      \"database_id\": \"YOUR_DATABASE_ID\"\n    }\n  ],\n\n  \"kv_namespaces\": [\n    {\n      \"binding\": \"EMAIL_CACHE\",\n      \"id\": \"YOUR_KV_ID\"\n    }\n  ]\n}\n```\n\n---\n\n## TypeScript Types\n\n### Environment Bindings\n\n```typescript\ninterface Env {\n  \u002F\u002F Send email bindings\n  EMAIL: SendEmail;\n  NOTIFICATIONS: SendEmail;\n  ALERTS: SendEmail;\n\n  \u002F\u002F Other bindings\n  DB: D1Database;\n  EMAIL_CACHE: KVNamespace;\n}\n\ninterface SendEmail {\n  send(message: EmailMessage): Promise\u003Cvoid>;\n}\n```\n\n### Full Type Definitions\n\n```typescript\nimport { EmailMessage } from 'cloudflare:email';\n\ninterface ForwardableEmailMessage {\n  readonly from: string;\n  readonly to: string;\n  readonly headers: Headers;\n  readonly raw: ReadableStream;\n  readonly rawSize: number;\n\n  setReject(reason: string): void;\n  forward(rcptTo: string, headers?: Headers): Promise\u003Cvoid>;\n  reply(message: EmailMessage): Promise\u003Cvoid>;\n}\n\ndeclare module 'cloudflare:email' {\n  export class EmailMessage {\n    constructor(from: string, to: string, raw: string | ReadableStream);\n  }\n}\n```\n\n---\n\n## Complete Setup Checklist\n\n### Email Routing Setup\n- [ ] Domain is on Cloudflare DNS\n- [ ] Email Routing enabled in dashboard\n- [ ] MX, SPF, DKIM records automatically added\n- [ ] At least one destination address verified\n- [ ] Test basic forwarding with a custom address\n\n### Email Workers (Receiving)\n- [ ] `postal-mime@2.5.0` installed\n- [ ] `mimetext@3.0.27` installed\n- [ ] Email worker created with `async email()` handler\n- [ ] Worker deployed: `npx wrangler deploy`\n- [ ] Worker bound to email route in dashboard\n- [ ] Test with real email to route address\n- [ ] Verify logs with `wrangler tail`\n\n### Send Email (Sending)\n- [ ] `send_email` binding configured in `wrangler.jsonc`\n- [ ] `destination_address` or `allowed_destination_addresses` specified\n- [ ] All destination addresses verified in Email Routing\n- [ ] Worker code uses `env.EMAIL.send()`\n- [ ] Worker deployed: `npx wrangler deploy`\n- [ ] Test sending email via Worker endpoint\n- [ ] Confirm email delivery to recipient\n\n---\n\n## Troubleshooting\n\n### Problem: \"Email Trigger not available to this workers\"\n\n**Solution**:\n- Deploy your worker: `npx wrangler deploy`\n- Test with real emails, not local simulation\n- Use `wrangler tail` to monitor processing\n\n---\n\n### Problem: \"Destination address not verified\"\n\n**Solution**:\n- Check Email Routing > Destination addresses in dashboard\n- Click \"Resend verification\" if needed\n- Create a regular forwarding rule first (workaround for bug)\n- Verify all addresses before deploying workers\n\n---\n\n### Problem: Gmail rejects emails with 421 error\n\n**Solution**:\n- Verify SPF\u002FDKIM records are configured (automatic with Email Routing)\n- Reduce sending rate (max 50-100\u002Fhour for personal use)\n- Don't send unsolicited emails or bulk mail\n- Consider transactional email service for high volume\n\n---\n\n### Problem: Emails not forwarding from Email Worker\n\n**Solution**:\n- Check worker is bound to correct email route in dashboard\n- Verify destination address is verified\n- Use `wrangler tail` to see processing logs\n- Check for errors in worker code (try\u002Fcatch around forward())\n- Confirm MX records are still pointing to Cloudflare\n\n---\n\n### Problem: Cannot see worker logs\n\n**Solution**:\n- Use `wrangler tail --format pretty` for live logs\n- Add extensive `console.log()` statements in worker\n- Store debug info in D1 or KV for later inspection\n- Upgrade to Workers Paid plan for better log retention\n\n---\n\n### Problem: Worker crashes with \"failed to call worker\"\n\n**Solution**:\n- Add try\u002Fcatch error handling around all operations\n- Set timeouts for external API calls\n- Test with different email formats (plain text, HTML, attachments)\n- Check worker doesn't exceed CPU\u002Fmemory limits\n- Use `ctx.waitUntil()` for non-blocking operations\n\n---\n\n## Advanced Topics\n\n### Parsing Email Attachments\n\n```typescript\nimport PostalMime from 'postal-mime';\n\nexport default {\n  async email(message, env, ctx) {\n    const parser = new PostalMime.default();\n    const email = await parser.parse(await new Response(message.raw).arrayBuffer());\n\n    \u002F\u002F Access attachments\n    if (email.attachments && email.attachments.length > 0) {\n      for (const attachment of email.attachments) {\n        console.log('Attachment:', attachment.filename);\n        console.log('Type:', attachment.mimeType);\n        console.log('Size:', attachment.content.length);\n\n        \u002F\u002F Store in R2\n        await env.BUCKET.put(\n          `emails\u002F${Date.now()}-${attachment.filename}`,\n          attachment.content\n        );\n      }\n    }\n\n    await message.forward('inbox@yourdomain.com');\n  },\n};\n```\n\n---\n\n### Email-Based Task Creation\n\n```typescript\nimport PostalMime from 'postal-mime';\n\nexport default {\n  async email(message, env, ctx) {\n    const parser = new PostalMime.default();\n    const email = await parser.parse(await new Response(message.raw).arrayBuffer());\n\n    \u002F\u002F Extract task from email subject\n    const taskMatch = email.subject.match(\u002F\\[TASK\\](.*)\u002Fi);\n\n    if (taskMatch) {\n      const taskDescription = taskMatch[1].trim();\n\n      \u002F\u002F Create task in D1\n      await env.DB.prepare(\n        'INSERT INTO tasks (description, created_by, created_at) VALUES (?, ?, ?)'\n      ).bind(\n        taskDescription,\n        message.from,\n        new Date().toISOString()\n      ).run();\n\n      \u002F\u002F Send confirmation\n      await message.reply(new EmailMessage(\n        'tasks@yourdomain.com',\n        message.from,\n        `Task created: ${taskDescription}`\n      ));\n    }\n  },\n};\n```\n\n---\n\n### Email-Triggered Workflows\n\n```typescript\nexport default {\n  async email(message, env, ctx) {\n    \u002F\u002F Trigger Cloudflare Workflow based on email\n    if (message.from.endsWith('@trusted-domain.com')) {\n      await env.WORKFLOW.create({\n        params: {\n          emailFrom: message.from,\n          emailTo: message.to,\n          receivedAt: new Date().toISOString(),\n        },\n      });\n    }\n\n    await message.forward('inbox@yourdomain.com');\n  },\n};\n```\n\n---\n\n## Dependencies\n\n**Required**:\n- `postal-mime@2.5.0` - Parse incoming email messages\n- `mimetext@3.0.27` - Create email messages for sending\n\n**Built-in**:\n- `cloudflare:email` - EmailMessage class (no installation needed)\n\n**Optional**:\n- `@cloudflare\u002Fworkers-types` - TypeScript type definitions\n\n---\n\n## Official Documentation\n\n- **Email Routing**: https:\u002F\u002Fdevelopers.cloudflare.com\u002Femail-routing\u002F\n- **Email Workers**: https:\u002F\u002Fdevelopers.cloudflare.com\u002Femail-routing\u002Femail-workers\u002F\n- **Send Email**: https:\u002F\u002Fdevelopers.cloudflare.com\u002Femail-routing\u002Femail-workers\u002Fsend-email-workers\u002F\n- **Runtime API**: https:\u002F\u002Fdevelopers.cloudflare.com\u002Femail-routing\u002Femail-workers\u002Fruntime-api\u002F\n- **Local Development**: https:\u002F\u002Fdevelopers.cloudflare.com\u002Femail-routing\u002Femail-workers\u002Flocal-development\u002F\n- **postal-mime**: https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002Fpostal-mime\n- **mimetext**: https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002Fmimetext\n\n---\n\n## Package Versions (Verified 2025-10-23)\n\n```json\n{\n  \"dependencies\": {\n    \"postal-mime\": \"^2.5.0\",\n    \"mimetext\": \"^3.0.27\"\n  },\n  \"devDependencies\": {\n    \"@cloudflare\u002Fworkers-types\": \"^4.20251014.0\",\n    \"wrangler\": \"^4.44.0\"\n  }\n}\n```\n\n---\n\n**Questions? Issues?**\n\n1. Check `references\u002Fcommon-errors.md` for detailed troubleshooting\n2. Review `references\u002Fdns-setup.md` for DNS configuration help\n3. See `references\u002Flocal-development.md` for testing patterns\n4. Check official docs: https:\u002F\u002Fdevelopers.cloudflare.com\u002Femail-routing\u002F\n5. Use `wrangler tail` for live debugging\n6. Verify all destination addresses are verified in dashboard\n","# Cloudflare Email Routing\n\n**Status**: Production Ready ✅\n**Last Updated**: 2025-10-23\n**Latest Versions**: postal-mime@2.5.0, mimetext@3.0.27\n\n---\n\n## What is Cloudflare Email Routing?\n\nCloudflare Email Routing provides two complementary capabilities:\n\n1. **Email Workers** - Receive and process incoming emails with custom logic (allowlists, blocklists, forwarding, parsing, replying)\n2. **Send Email** - Send emails from Workers to verified destination addresses (notifications, alerts, confirmations)\n\nBoth capabilities are **free** and work together to enable complete email functionality in Cloudflare Workers.\n\n---\n\n## Quick Start (10 Minutes)\n\n### Part 1: Enable Email Routing (Dashboard)\n\n**Prerequisites**: Domain must be on Cloudflare DNS\n\n1. Log in to Cloudflare Dashboard → select your domain\n2. Go to **Email** > **Email Routing**\n3. Select **Enable Email Routing** → **Add records and enable**\n   - This automatically adds MX records, SPF, and DKIM to your DNS\n4. Create a destination address:\n   - **Custom address**: `hello@yourdomain.com`\n   - **Destination**: Your personal email (e.g., `you@gmail.com`)\n   - **Verify** the destination address via email\n5. ✅ Basic email forwarding is now active\n\n**What you just did**: Configured DNS and basic forwarding. Now let's add Workers for custom logic.\n\n---\n\n### Part 2: Receiving Emails with Email Workers\n\n#### 1. Install Dependencies\n\n```bash\nnpm install postal-mime@2.5.0 mimetext@3.0.27\n```\n\n**Why these packages:**\n- `postal-mime` - Parse incoming email messages (headers, body, attachments)\n- `mimetext` - Create email messages for sending\u002Freplying\n\n#### 2. Create Email Worker\n\nCreate `src\u002Femail.ts`:\n\n```typescript\nimport { EmailMessage } from 'cloudflare:email';\nimport PostalMime from 'postal-mime';\n\nexport default {\n  async email(message, env, ctx) {\n    \u002F\u002F Parse the incoming message\n    const parser = new PostalMime.default();\n    const email = await parser.parse(await new Response(message.raw).arrayBuffer());\n\n    console.log('From:', message.from);\n    console.log('To:', message.to);\n    console.log('Subject:', email.subject);\n\n    \u002F\u002F Forward to verified destination\n    await message.forward('your-email@example.com');\n  },\n};\n```\n\n#### 3. Configure Wrangler\n\nUpdate `wrangler.jsonc`:\n\n```jsonc\n{\n  \"name\": \"email-worker\",\n  \"main\": \"src\u002Femail.ts\",\n  \"compatibility_date\": \"2025-10-11\"\n}\n```\n\n#### 4. Deploy and Bind\n\n```bash\nnpx wrangler deploy\n\n# In Cloudflare Dashboard:\n# Email > Email Routing > Email Workers\n# Select your worker → Create route → Enter address (e.g., hello@yourdomain.com)\n```\n\n**What you just did**: Created a Worker that logs and forwards emails.\n\n---\n\n### Part 3: Sending Emails from Workers\n\n#### 1. Configure Send Email Binding\n\nUpdate `wrangler.jsonc`:\n\n```jsonc\n{\n  \"name\": \"my-worker\",\n  \"main\": \"src\u002Findex.ts\",\n  \"compatibility_date\": \"2025-10-11\",\n  \"send_email\": [\n    {\n      \"name\": \"EMAIL\",\n      \"destination_address\": \"notifications@yourdomain.com\"\n    }\n  ]\n}\n```\n\n**CRITICAL**: `destination_address` must be:\n- A domain where you have Email Routing enabled\n- A verified destination address in Email Routing settings\n\n#### 2. Send Email from Worker\n\n```typescript\nimport { EmailMessage } from 'cloudflare:email';\nimport { createMimeMessage } from 'mimetext';\n\nexport default {\n  async fetch(request, env, ctx) {\n    \u002F\u002F Create email message\n    const msg = createMimeMessage();\n    msg.setSender({ name: 'My App', addr: 'noreply@yourdomain.com' });\n    msg.setRecipient('user@example.com');\n    msg.setSubject('Welcome to My App');\n    msg.addMessage({\n      contentType: 'text\u002Fplain',\n      data: 'Thank you for signing up!',\n    });\n\n    \u002F\u002F Send via binding\n    const message = new EmailMessage(\n      'noreply@yourdomain.com',\n      'user@example.com',\n      msg.asRaw()\n    );\n\n    await env.EMAIL.send(message);\n\n    return new Response('Email sent!');\n  },\n};\n```\n\n#### 3. Deploy\n\n```bash\nnpx wrangler deploy\n```\n\n**What you just did**: Configured your Worker to send emails to verified addresses.\n\n---\n\n## Email Workers: Complete Guide\n\n### Runtime API\n\n#### EmailEvent Handler\n\n```typescript\nexport default {\n  async email(message: ForwardableEmailMessage, env: Env, ctx: ExecutionContext) {\n    \u002F\u002F Process email here\n  },\n};\n```\n\n**Parameters:**\n- `message` - ForwardableEmailMessage object\n- `env` - Environment bindings (KV, D1, secrets, etc.)\n- `ctx` - Execution context (waitUntil for async operations)\n\n#### ForwardableEmailMessage Properties\n\n```typescript\ninterface ForwardableEmailMessage {\n  readonly from: string;          \u002F\u002F Sender email\n  readonly to: string;            \u002F\u002F Recipient email\n  readonly headers: Headers;      \u002F\u002F Email headers\n  readonly raw: ReadableStream;   \u002F\u002F Raw email message\n  readonly rawSize: number;       \u002F\u002F Size in bytes\n\n  \u002F\u002F Methods\n  setReject(reason: string): void;\n  forward(rcptTo: string, headers?: Headers): Promise\u003Cvoid>;\n  reply(message: EmailMessage): Promise\u003Cvoid>;\n}\n```\n\n---\n\n## Common Patterns\n\n### Pattern 1: Allowlist\n\nOnly accept emails from approved senders:\n\n```typescript\nexport default {\n  async email(message, env, ctx) {\n    const allowList = [\n      'friend@example.com',\n      'coworker@company.com',\n      'support@vendor.com',\n    ];\n\n    if (!allowList.includes(message.from)) {\n      message.setReject('Address not on allowlist');\n      return;\n    }\n\n    await message.forward('inbox@yourdomain.com');\n  },\n};\n```\n\n**When to use**: Contact forms, private email addresses, team inboxes\n\n---\n\n### Pattern 2: Blocklist\n\nReject emails from specific senders or domains:\n\n```typescript\nexport default {\n  async email(message, env, ctx) {\n    const blockList = [\n      'spam@badactor.com',\n      '@suspicious-domain.com', \u002F\u002F Block entire domain\n    ];\n\n    const isBlocked = blockList.some(pattern =>\n      message.from.includes(pattern)\n    );\n\n    if (isBlocked) {\n      message.setReject('Sender blocked');\n      return;\n    }\n\n    await message.forward('inbox@yourdomain.com');\n  },\n};\n```\n\n**When to use**: Spam filtering, blocking harassers, domain-level blocks\n\n---\n\n### Pattern 3: Parse and Store\n\nExtract email content and store in D1 or KV:\n\n```typescript\nimport PostalMime from 'postal-mime';\n\nexport default {\n  async email(message, env, ctx) {\n    \u002F\u002F Parse email\n    const parser = new PostalMime.default();\n    const rawEmail = new Response(message.raw);\n    const email = await parser.parse(await rawEmail.arrayBuffer());\n\n    \u002F\u002F Store in D1\n    await env.DB.prepare(\n      'INSERT INTO emails (from_addr, subject, text, received_at) VALUES (?, ?, ?, ?)'\n    ).bind(\n      message.from,\n      email.subject,\n      email.text,\n      new Date().toISOString()\n    ).run();\n\n    \u002F\u002F Forward to inbox\n    await message.forward('inbox@yourdomain.com');\n  },\n};\n```\n\n**When to use**: Email archiving, ticket systems, support inboxes, audit logs\n\n---\n\n### Pattern 4: Auto-Reply\n\nSend automatic replies with custom logic:\n\n```typescript\nimport PostalMime from 'postal-mime';\nimport { createMimeMessage } from 'mimetext';\nimport { EmailMessage } from 'cloudflare:email';\n\nexport default {\n  async email(message, env, ctx) {\n    \u002F\u002F Parse incoming email\n    const parser = new PostalMime.default();\n    const email = await parser.parse(await new Response(message.raw).arrayBuffer());\n\n    \u002F\u002F Create reply\n    const msg = createMimeMessage();\n    msg.setSender({ name: 'Support Team', addr: 'support@yourdomain.com' });\n    msg.setRecipient(message.from);\n    msg.setHeader('In-Reply-To', message.headers.get('Message-ID'));\n    msg.setSubject(`Re: ${email.subject}`);\n    msg.addMessage({\n      contentType: 'text\u002Fplain',\n      data: `Thank you for your message about \"${email.subject}\". We'll respond within 24 hours.`,\n    });\n\n    \u002F\u002F Send reply\n    const replyMessage = new EmailMessage(\n      'support@yourdomain.com',\n      message.from,\n      msg.asRaw()\n    );\n\n    await message.reply(replyMessage);\n\n    \u002F\u002F Also forward to team inbox\n    await message.forward('team@yourdomain.com');\n  },\n};\n```\n\n**When to use**: Out-of-office replies, support ticket acknowledgments, automated responses\n\n---\n\n### Pattern 5: Conditional Routing\n\nRoute emails to different destinations based on content:\n\n```typescript\nimport PostalMime from 'postal-mime';\n\nexport default {\n  async email(message, env, ctx) {\n    const parser = new PostalMime.default();\n    const email = await parser.parse(await new Response(message.raw).arrayBuffer());\n\n    const subject = email.subject.toLowerCase();\n\n    \u002F\u002F Route based on subject keywords\n    if (subject.includes('urgent') || subject.includes('critical')) {\n      await message.forward('oncall@yourdomain.com');\n    } else if (subject.includes('invoice') || subject.includes('payment')) {\n      await message.forward('billing@yourdomain.com');\n    } else if (subject.includes('support') || subject.includes('help')) {\n      await message.forward('support@yourdomain.com');\n    } else {\n      await message.forward('inbox@yourdomain.com');\n    }\n  },\n};\n```\n\n**When to use**: Department routing, priority filtering, category-based inboxes\n\n---\n\n## Send Email: Complete Guide\n\n### Configuration\n\n#### Single Destination (Simple)\n\n```jsonc\n{\n  \"send_email\": [\n    {\n      \"name\": \"EMAIL\",\n      \"destination_address\": \"notifications@yourdomain.com\"\n    }\n  ]\n}\n```\n\n**Behavior**: All emails sent via `env.EMAIL` go to this address.\n\n#### Multiple Destinations (Flexible)\n\n```jsonc\n{\n  \"send_email\": [\n    {\n      \"name\": \"EMAIL\",\n      \"allowed_destination_addresses\": [\n        \"notifications@yourdomain.com\",\n        \"alerts@yourdomain.com\",\n        \"user@gmail.com\"\n      ]\n    }\n  ]\n}\n```\n\n**Behavior**: Can send to any address in the list.\n\n#### Multiple Bindings (Organized)\n\n```jsonc\n{\n  \"send_email\": [\n    {\n      \"name\": \"NOTIFICATIONS\",\n      \"destination_address\": \"notifications@yourdomain.com\"\n    },\n    {\n      \"name\": \"ALERTS\",\n      \"destination_address\": \"alerts@yourdomain.com\"\n    }\n  ]\n}\n```\n\n**Behavior**: Use different bindings for different purposes.\n\n---\n\n### Sending Emails\n\n#### Basic Text Email\n\n```typescript\nimport { EmailMessage } from 'cloudflare:email';\nimport { createMimeMessage } from 'mimetext';\n\nconst msg = createMimeMessage();\nmsg.setSender({ name: 'My App', addr: 'noreply@yourdomain.com' });\nmsg.setRecipient('user@example.com');\nmsg.setSubject('Welcome!');\nmsg.addMessage({\n  contentType: 'text\u002Fplain',\n  data: 'Welcome to our service!',\n});\n\nconst email = new EmailMessage(\n  'noreply@yourdomain.com',\n  'user@example.com',\n  msg.asRaw()\n);\n\nawait env.EMAIL.send(email);\n```\n\n#### HTML Email\n\n```typescript\nimport { EmailMessage } from 'cloudflare:email';\nimport { createMimeMessage } from 'mimetext';\n\nconst msg = createMimeMessage();\nmsg.setSender({ name: 'My App', addr: 'noreply@yourdomain.com' });\nmsg.setRecipient('user@example.com');\nmsg.setSubject('Welcome!');\n\n\u002F\u002F Add both plain text and HTML versions\nmsg.addMessage({\n  contentType: 'text\u002Fplain',\n  data: 'Welcome to our service!',\n});\n\nmsg.addMessage({\n  contentType: 'text\u002Fhtml',\n  data: '\u003Ch1>Welcome!\u003C\u002Fh1>\u003Cp>Thanks for joining us.\u003C\u002Fp>',\n});\n\nconst email = new EmailMessage(\n  'noreply@yourdomain.com',\n  'user@example.com',\n  msg.asRaw()\n);\n\nawait env.EMAIL.send(email);\n```\n\n#### Email with Custom Headers\n\n```typescript\nimport { EmailMessage } from 'cloudflare:email';\nimport { createMimeMessage } from 'mimetext';\n\nconst msg = createMimeMessage();\nmsg.setSender({ name: 'My App', addr: 'noreply@yourdomain.com' });\nmsg.setRecipient('user@example.com');\nmsg.setSubject('Password Reset');\n\n\u002F\u002F Add custom headers\nmsg.setHeader('X-Priority', '1');\nmsg.setHeader('X-Application-ID', 'my-app-123');\n\nmsg.addMessage({\n  contentType: 'text\u002Fplain',\n  data: 'Click here to reset your password...',\n});\n\nconst email = new EmailMessage(\n  'noreply@yourdomain.com',\n  'user@example.com',\n  msg.asRaw()\n);\n\nawait env.EMAIL.send(email);\n```\n\n---\n\n## DNS Configuration\n\n### Automatic Setup (Recommended)\n\nWhen you enable Email Routing in the dashboard, Cloudflare automatically adds:\n\n1. **MX Records** - Direct email to Cloudflare's servers\n   ```\n   yourdomain.com. 300 IN MX 13 amir.mx.cloudflare.net.\n   yourdomain.com. 300 IN MX 86 linda.mx.cloudflare.net.\n   yourdomain.com. 300 IN MX 24 isaac.mx.cloudflare.net.\n   ```\n\n2. **SPF Record** - Authorize Cloudflare to send on your behalf\n   ```\n   yourdomain.com. 300 IN TXT \"v=spf1 include:_spf.mx.cloudflare.net ~all\"\n   ```\n\n3. **DKIM Records** - Sign outgoing emails\n   ```\n   Automatically configured per domain\n   ```\n\n### Manual Setup (Advanced)\n\nIf you need to migrate from another provider:\n\n1. Go to **Email > Email Routing > Settings**\n2. Select **Start disabling > Unlock records and continue**\n3. Edit DNS records as needed\n4. When ready, **Lock DNS records** to protect Email Routing\n\n**WARNING**: Changing MX records will break Email Routing. Only do this if migrating providers.\n\n---\n\n## Known Issues Prevention\n\nThis skill prevents **8 documented issues**:\n\n### Issue #1: \"Email Trigger not available to this workers\"\n\n**Error**: Testing email workers fails with \"Email Trigger not available to this workers\"\n\n**Source**: [workers-sdk #3751](https:\u002F\u002Fgithub.com\u002Fcloudflare\u002Fworkers-sdk\u002Fissues\u002F3751)\n\n**Why It Happens**: Wrangler dev doesn't fully support email triggers; testing must be done via deployed Workers\n\n**Prevention**:\n- Always deploy email workers before testing\n- Use `wrangler tail` for live debugging\n- Use dashboard \"Test Email Event\" feature (when working)\n\n---\n\n### Issue #2: Destination Address Verification Bug\n\n**Error**: Verified destination addresses show as \"unverified\" in Email Worker forwarding\n\n**Source**: Community reports ([Cloudflare Community](https:\u002F\u002Fcommunity.cloudflare.com\u002Ft\u002Femail-worker-free-reliability\u002F486680))\n\n**Why It Happens**: Bug in dashboard where addresses only show verified if also used in regular routing rules\n\n**Prevention**:\n- Create a regular forward rule for each destination address first\n- Then use the same addresses in Email Workers\n- Verify addresses before deploying workers\n\n---\n\n### Issue #3: Gmail Rate Limiting\n\n**Error**: \"421: Our system has detected an unusual rate of unsolicited mail originating from your IP address\"\n\n**Source**: Community reports\n\n**Why It Happens**: Gmail may flag Cloudflare's IP ranges as suspicious due to shared infrastructure\n\n**Prevention**:\n- Implement proper SPF\u002FDKIM\u002FDMARC records\n- Don't send bulk emails through Email Routing\n- Use transactional email services (e.g., SendGrid, Mailgun) for high volume\n- Rate-limit your sending (max 50-100 emails\u002Fhour for personal use)\n\n---\n\n### Issue #4: SPF Permerror with MailChannels\n\n**Error**: SPF permerror when routing through MailChannels\n\n**Source**: [Community discussion](https:\u002F\u002Fcommunity.cloudflare.com\u002Ft\u002Fworker-mailchannels-email-routing-spf-permerror\u002F637766)\n\n**Why It Happens**: SPF record chain breaks when forwarding through multiple services\n\n**Prevention**:\n- Use Email Routing's native send capabilities instead of MailChannels\n- If using MailChannels, configure SPF includes correctly\n- Test with [MXToolbox SPF checker](https:\u002F\u002Fmxtoolbox.com\u002Fspf.aspx)\n\n---\n\n### Issue #5: Limited Logging on Free Plan\n\n**Error**: Cannot see worker logs or email processing details\n\n**Source**: Community reports\n\n**Why It Happens**: Free plan has limited log retention and streaming\n\n**Prevention**:\n- Use `wrangler tail` during development for live logs\n- Use `console.log()` extensively in email workers\n- Store critical data in D1\u002FKV for debugging\n- Upgrade to Workers Paid plan for better observability\n\n---\n\n### Issue #6: Activity Log Discrepancies\n\n**Error**: Emails show as \"Dropped\" in Activity Log even when successfully forwarded\n\n**Source**: Community reports\n\n**Why It Happens**: Dashboard bug showing incorrect status\n\n**Prevention**:\n- Check actual email delivery instead of relying on dashboard\n- Use `wrangler tail` to verify processing\n- Implement your own logging in D1\u002FKV\n- Test with real emails to confirm delivery\n\n---\n\n### Issue #7: Test Email Event Loading Indefinitely\n\n**Error**: Dashboard \"Test Email Event\" button remains in loading state forever\n\n**Source**: [workers-sdk #9195](https:\u002F\u002Fgithub.com\u002Fcloudflare\u002Fworkers-sdk\u002Fissues\u002F9195)\n\n**Why It Happens**: Bug in dashboard testing interface (unresolved as of 2025-10)\n\n**Prevention**:\n- Don't rely on dashboard testing feature\n- Use `curl` with local development instead (see Local Development section)\n- Deploy and test with real emails\n- Use `wrangler tail` to monitor processing\n\n---\n\n### Issue #8: Worker Call Failures\n\n**Error**: \"Rejected reason: Unknown error: failed to call worker: Worker call failed for 3 times, aborting…\"\n\n**Source**: [workers-sdk #9069](https:\u002F\u002Fgithub.com\u002Fcloudflare\u002Fworkers-sdk\u002Fissues\u002F9069), Community reports\n\n**Why It Happens**: Worker crashes due to runtime errors, timeouts, or memory issues\n\n**Prevention**:\n- Add comprehensive error handling with try\u002Fcatch\n- Set timeouts for external API calls\n- Log errors to D1\u002FKV before rejecting\n- Use `ctx.waitUntil()` for non-critical operations\n- Test with various email formats (plain text, HTML, attachments)\n\n---\n\n## Local Development\n\n### Receiving Emails\n\nWrangler simulates email reception via HTTP POST:\n\n```bash\n# Start dev server\nnpx wrangler dev\n\n# In another terminal, send test email\ncurl http:\u002F\u002Flocalhost:8787 -X POST \\\n  --data-binary @- \u003C\u003C EOF\nFrom: sender@example.com\nTo: recipient@yourdomain.com\nSubject: Test Email\n\nThis is a test email body.\nEOF\n```\n\n**What happens**: Wrangler logs the email processing and shows where forwarded emails would go.\n\n### Sending Emails\n\nWrangler writes sent emails to local .eml files:\n\n```typescript\n\u002F\u002F Your worker code\nawait env.EMAIL.send(message);\n```\n\n**Output in terminal**:\n```\n[wrangler:inf] send_email binding called with the following message:\n  \u002Ftmp\u002Fminiflare-abc123\u002Ffiles\u002Femail\u002Fmessage-123.eml\n```\n\n**View the email**:\n```bash\ncat \u002Ftmp\u002Fminiflare-abc123\u002Ffiles\u002Femail\u002Fmessage-123.eml\n```\n\n---\n\n## Configuration Files Reference\n\n### Complete wrangler.jsonc (Both Receive + Send)\n\n```jsonc\n{\n  \"$schema\": \"node_modules\u002Fwrangler\u002Fconfig-schema.json\",\n  \"name\": \"email-worker\",\n  \"main\": \"src\u002Femail.ts\",\n  \"account_id\": \"YOUR_ACCOUNT_ID\",\n  \"compatibility_date\": \"2025-10-11\",\n  \"observability\": {\n    \"enabled\": true\n  },\n\n  \u002F\u002F Send email binding\n  \"send_email\": [\n    {\n      \"name\": \"NOTIFICATIONS\",\n      \"destination_address\": \"notifications@yourdomain.com\"\n    },\n    {\n      \"name\": \"ALERTS\",\n      \"allowed_destination_addresses\": [\n        \"alerts@yourdomain.com\",\n        \"admin@yourdomain.com\"\n      ]\n    }\n  ],\n\n  \u002F\u002F Optional: Add other bindings\n  \"d1_databases\": [\n    {\n      \"binding\": \"DB\",\n      \"database_name\": \"email-archive\",\n      \"database_id\": \"YOUR_DATABASE_ID\"\n    }\n  ],\n\n  \"kv_namespaces\": [\n    {\n      \"binding\": \"EMAIL_CACHE\",\n      \"id\": \"YOUR_KV_ID\"\n    }\n  ]\n}\n```\n\n---\n\n## TypeScript Types\n\n### Environment Bindings\n\n```typescript\ninterface Env {\n  \u002F\u002F Send email bindings\n  EMAIL: SendEmail;\n  NOTIFICATIONS: SendEmail;\n  ALERTS: SendEmail;\n\n  \u002F\u002F Other bindings\n  DB: D1Database;\n  EMAIL_CACHE: KVNamespace;\n}\n\ninterface SendEmail {\n  send(message: EmailMessage): Promise\u003Cvoid>;\n}\n```\n\n### Full Type Definitions\n\n```typescript\nimport { EmailMessage } from 'cloudflare:email';\n\ninterface ForwardableEmailMessage {\n  readonly from: string;\n  readonly to: string;\n  readonly headers: Headers;\n  readonly raw: ReadableStream;\n  readonly rawSize: number;\n\n  setReject(reason: string): void;\n  forward(rcptTo: string, headers?: Headers): Promise\u003Cvoid>;\n  reply(message: EmailMessage): Promise\u003Cvoid>;\n}\n\ndeclare module 'cloudflare:email' {\n  export class EmailMessage {\n    constructor(from: string, to: string, raw: string | ReadableStream);\n  }\n}\n```\n\n---\n\n## Complete Setup Checklist\n\n### Email Routing Setup\n- [ ] Domain is on Cloudflare DNS\n- [ ] Email Routing enabled in dashboard\n- [ ] MX, SPF, DKIM records automatically added\n- [ ] At least one destination address verified\n- [ ] Test basic forwarding with a custom address\n\n### Email Workers (Receiving)\n- [ ] `postal-mime@2.5.0` installed\n- [ ] `mimetext@3.0.27` installed\n- [ ] Email worker created with `async email()` handler\n- [ ] Worker deployed: `npx wrangler deploy`\n- [ ] Worker bound to email route in dashboard\n- [ ] Test with real email to route address\n- [ ] Verify logs with `wrangler tail`\n\n### Send Email (Sending)\n- [ ] `send_email` binding configured in `wrangler.jsonc`\n- [ ] `destination_address` or `allowed_destination_addresses` specified\n- [ ] All destination addresses verified in Email Routing\n- [ ] Worker code uses `env.EMAIL.send()`\n- [ ] Worker deployed: `npx wrangler deploy`\n- [ ] Test sending email via Worker endpoint\n- [ ] Confirm email delivery to recipient\n\n---\n\n## Troubleshooting\n\n### Problem: \"Email Trigger not available to this workers\"\n\n**Solution**:\n- Deploy your worker: `npx wrangler deploy`\n- Test with real emails, not local simulation\n- Use `wrangler tail` to monitor processing\n\n---\n\n### Problem: \"Destination address not verified\"\n\n**Solution**:\n- Check Email Routing > Destination addresses in dashboard\n- Click \"Resend verification\" if needed\n- Create a regular forwarding rule first (workaround for bug)\n- Verify all addresses before deploying workers\n\n---\n\n### Problem: Gmail rejects emails with 421 error\n\n**Solution**:\n- Verify SPF\u002FDKIM records are configured (automatic with Email Routing)\n- Reduce sending rate (max 50-100\u002Fhour for personal use)\n- Don't send unsolicited emails or bulk mail\n- Consider transactional email service for high volume\n\n---\n\n### Problem: Emails not forwarding from Email Worker\n\n**Solution**:\n- Check worker is bound to correct email route in dashboard\n- Verify destination address is verified\n- Use `wrangler tail` to see processing logs\n- Check for errors in worker code (try\u002Fcatch around forward())\n- Confirm MX records are still pointing to Cloudflare\n\n---\n\n### Problem: Cannot see worker logs\n\n**Solution**:\n- Use `wrangler tail --format pretty` for live logs\n- Add extensive `console.log()` statements in worker\n- Store debug info in D1 or KV for later inspection\n- Upgrade to Workers Paid plan for better log retention\n\n---\n\n### Problem: Worker crashes with \"failed to call worker\"\n\n**Solution**:\n- Add try\u002Fcatch error handling around all operations\n- Set timeouts for external API calls\n- Test with different email formats (plain text, HTML, attachments)\n- Check worker doesn't exceed CPU\u002Fmemory limits\n- Use `ctx.waitUntil()` for non-blocking operations\n\n---\n\n## Advanced Topics\n\n### Parsing Email Attachments\n\n```typescript\nimport PostalMime from 'postal-mime';\n\nexport default {\n  async email(message, env, ctx) {\n    const parser = new PostalMime.default();\n    const email = await parser.parse(await new Response(message.raw).arrayBuffer());\n\n    \u002F\u002F Access attachments\n    if (email.attachments && email.attachments.length > 0) {\n      for (const attachment of email.attachments) {\n        console.log('Attachment:', attachment.filename);\n        console.log('Type:', attachment.mimeType);\n        console.log('Size:', attachment.content.length);\n\n        \u002F\u002F Store in R2\n        await env.BUCKET.put(\n          `emails\u002F${Date.now()}-${attachment.filename}`,\n          attachment.content\n        );\n      }\n    }\n\n    await message.forward('inbox@yourdomain.com');\n  },\n};\n```\n\n---\n\n### Email-Based Task Creation\n\n```typescript\nimport PostalMime from 'postal-mime';\n\nexport default {\n  async email(message, env, ctx) {\n    const parser = new PostalMime.default();\n    const email = await parser.parse(await new Response(message.raw).arrayBuffer());\n\n    \u002F\u002F Extract task from email subject\n    const taskMatch = email.subject.match(\u002F\\[TASK\\](.*)\u002Fi);\n\n    if (taskMatch) {\n      const taskDescription = taskMatch[1].trim();\n\n      \u002F\u002F Create task in D1\n      await env.DB.prepare(\n        'INSERT INTO tasks (description, created_by, created_at) VALUES (?, ?, ?)'\n      ).bind(\n        taskDescription,\n        message.from,\n        new Date().toISOString()\n      ).run();\n\n      \u002F\u002F Send confirmation\n      await message.reply(new EmailMessage(\n        'tasks@yourdomain.com',\n        message.from,\n        `Task created: ${taskDescription}`\n      ));\n    }\n  },\n};\n```\n\n---\n\n### Email-Triggered Workflows\n\n```typescript\nexport default {\n  async email(message, env, ctx) {\n    \u002F\u002F Trigger Cloudflare Workflow based on email\n    if (message.from.endsWith('@trusted-domain.com')) {\n      await env.WORKFLOW.create({\n        params: {\n          emailFrom: message.from,\n          emailTo: message.to,\n          receivedAt: new Date().toISOString(),\n        },\n      });\n    }\n\n    await message.forward('inbox@yourdomain.com');\n  },\n};\n```\n\n---\n\n## Dependencies\n\n**Required**:\n- `postal-mime@2.5.0` - Parse incoming email messages\n- `mimetext@3.0.27` - Create email messages for sending\n\n**Built-in**:\n- `cloudflare:email` - EmailMessage class (no installation needed)\n\n**Optional**:\n- `@cloudflare\u002Fworkers-types` - TypeScript type definitions\n\n---\n\n## Official Documentation\n\n- **Email Routing**: https:\u002F\u002Fdevelopers.cloudflare.com\u002Femail-routing\u002F\n- **Email Workers**: https:\u002F\u002Fdevelopers.cloudflare.com\u002Femail-routing\u002Femail-workers\u002F\n- **Send Email**: https:\u002F\u002Fdevelopers.cloudflare.com\u002Femail-routing\u002Femail-workers\u002Fsend-email-workers\u002F\n- **Runtime API**: https:\u002F\u002Fdevelopers.cloudflare.com\u002Femail-routing\u002Femail-workers\u002Fruntime-api\u002F\n- **Local Development**: https:\u002F\u002Fdevelopers.cloudflare.com\u002Femail-routing\u002Femail-workers\u002Flocal-development\u002F\n- **postal-mime**: https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002Fpostal-mime\n- **mimetext**: https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002Fmimetext\n\n---\n\n## Package Versions (Verified 2025-10-23)\n\n```json\n{\n  \"dependencies\": {\n    \"postal-mime\": \"^2.5.0\",\n    \"mimetext\": \"^3.0.27\"\n  },\n  \"devDependencies\": {\n    \"@cloudflare\u002Fworkers-types\": \"^4.20251014.0\",\n    \"wrangler\": \"^4.44.0\"\n  }\n}\n```\n\n---\n\n**Questions? Issues?**\n\n1. Check `references\u002Fcommon-errors.md` for detailed troubleshooting\n2. Review `references\u002Fdns-setup.md` for DNS configuration help\n3. See `references\u002Flocal-development.md` for testing patterns\n4. Check official docs: https:\u002F\u002Fdevelopers.cloudflare.com\u002Femail-routing\u002F\n5. Use `wrangler tail` for live debugging\n6. Verify all destination addresses are verified in dashboard\n",{"name":5,"license":14,"description":23},"Complete guide for Cloudflare Email Routing covering both Email Workers (receiving emails) and Send Email bindings (sending emails from Workers).\n\nUse when: setting up email routing, creating email workers, processing incoming emails, sending emails from Workers, implementing email allowlists\u002Fblocklists, forwarding emails with custom logic, replying to emails automatically, parsing email content, configuring MX records for email, troubleshooting email delivery issues, or encountering email worker errors.\n\nPrevents 8 documented issues: \"Email Trigger not available\" errors, destination address verification bugs, Gmail rate limiting, SPF permerror issues, worker call failures, test event loading issues, activity log discrepancies, and limited debugging on free plans.\n\nKeywords: Cloudflare Email Routing, Email Workers, send email, receive email, email forwarding, email allowlist, email blocklist, postal-mime, mimetext, cloudflare:email, EmailMessage, ForwardableEmailMessage, EmailEvent, MX records, SPF, DKIM, email worker binding, send_email binding, wrangler email, email handler, email routing worker, \"Email Trigger not available\", \"failed to call worker\", email delivery failed, email not forwarding, destination address not verified\n","main","45d5ac830c3e238eeba6d0b4e6fd7cf6b56bf380","https:\u002F\u002Fgithub.com\u002Fdavidanthonyn\u002Fclaude-skills","https:\u002F\u002Fgithub.com\u002Fdavidanthonyn","2026-09-09 16:05:56",{"source":8,"skillName":5,"commands":30,"prompt":40,"zipAvailable":41},[31,34,37],{"tool":32,"command":33},"npx","npx skills add davidanthonyn\u002Fclaude-skills --skill cloudflare-email-routing",{"tool":35,"command":36},"bunx","bunx skills add davidanthonyn\u002Fclaude-skills --skill cloudflare-email-routing",{"tool":38,"command":39},"pnpm","pnpm dlx skills add davidanthonyn\u002Fclaude-skills --skill cloudflare-email-routing","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fdavidanthonyn\u002Fclaude-skills\u002Fblob\u002Fmain\u002Fcloudflare-email-routing\u002FSKILL.md",true,[43,49,53],{"path":44,"resourceType":45,"resourceTypeDesc":46,"sizeBytes":47,"sourceHtmlUrl":48},"README.md","REFERENCE","参考文档",6349,"https:\u002F\u002Fgithub.com\u002Fdavidanthonyn\u002Fclaude-skills\u002Fblob\u002Fmain\u002Fcloudflare-email-routing\u002FREADME.md",{"path":50,"resourceType":45,"resourceTypeDesc":46,"sizeBytes":51,"sourceHtmlUrl":52},"SKILL.json",29598,"https:\u002F\u002Fgithub.com\u002Fdavidanthonyn\u002Fclaude-skills\u002Fblob\u002Fmain\u002Fcloudflare-email-routing\u002FSKILL.json",{"path":54,"resourceType":55,"resourceTypeDesc":56,"sizeBytes":57,"sourceHtmlUrl":58},"SKILL.md.backup","OTHER","其他",27561,"https:\u002F\u002Fgithub.com\u002Fdavidanthonyn\u002Fclaude-skills\u002Fblob\u002Fmain\u002Fcloudflare-email-routing\u002FSKILL.md.backup",[60,67,75,82,89,98],{"skillNo":61,"name":62,"nameZh":6,"description":63,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":64,"categories":65,"keywords":66,"publishedAt":18},"01M7AQPHJF528A4MD52YZEZV3R","zustand-state-management","Production-tested setup for Zustand state management in React applications with TypeScript.\nThis skill provides comprehensive patterns for building scalable, type-safe global state.\n\nUse when: setting up global state in React, migrating from Redux or Context API, implementing\nstate persistence with localStorage, configuring TypeScript with Zustand, using slices pattern\nfor modular stores, adding devtools middleware for debugging, handling Next.js SSR hydration,\nor encountering hydration errors, TypeScript inference issues, or persist middleware problems.\n\nPrevents 5 documented issues: Next.js hydration mismatches, TypeScript double parentheses\nsyntax errors, persist middleware export errors, infinite render loops, and slices pattern\ntype inference failures.\n\nKeywords: zustand, state management, React state, TypeScript state, persist middleware,\ndevtools, slices pattern, global state, React hooks, create store, useBoundStore,\nStateCreator, hydration error, text content mismatch, infinite render, localStorage,\nsessionStorage, immer middleware, shallow equality, selector pattern, zustand v5","https:\u002F\u002Fgithub.com\u002Fdavidanthonyn\u002Fclaude-skills\u002Fblob\u002Fmain\u002Fzustand-state-management\u002FSKILL.md",[],[],{"skillNo":68,"name":69,"nameZh":6,"description":70,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":71,"sourceHtmlUrl":72,"categories":73,"keywords":74,"publishedAt":18},"01M7AQP2XJRPNYEH323GJ81NN5","zetic-mlange","Help users integrate the ZETIC Melange (MLange) on-device AI SDK into Android (Kotlin\u002FJava) and iOS (Swift) mobile apps. Use this skill whenever the user mentions Zetic, MLange, Melange, ZeticMLangeModel, ZeticMLangeLLMModel, ZeticMLangeHFModel, on-device NPU inference for mobile, or deploying ML models to Android\u002FiOS with NPU acceleration. Also trigger when users ask about running LLMs on-device with GGUF quantization, mobile NPU model deployment, or converting PyTorch\u002FONNX models for mobile inference. Covers general model inference, LLM inference (streaming token generation), and HuggingFace model loading.","https:\u002F\u002Fgithub.com\u002Fdavidanthonyn\u002Fclaude-skills\u002Fblob\u002Fmain\u002Fzetic-mlange\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fdavidanthonyn\u002Fclaude-skills\u002Fblob\u002Fmain\u002Fzetic-mlange\u002FSKILL.md",[],[],{"skillNo":76,"name":77,"nameZh":6,"description":78,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":18},"01M7AQNEJHD27NNF5PYQDSW8B9","youtube-downloader","Download videos, audio, playlists, and channels from YouTube and 1000+ websites using yt-dlp. Supports quality selection, format conversion, subtitle download, playlist filtering, metadata extraction, thumbnail download, and batch operations. Use when downloading YouTube videos in any quality (4K, 8K, HDR), extracting audio as MP3\u002FM4A\u002FFLAC, downloading entire playlists\u002Fchannels, getting subtitles in multiple languages, converting to specific formats, downloading live streams, archiving content, or batch processing multiple URLs. Optimized for reliability with automatic retries, rate limiting, and error handling.","https:\u002F\u002Fgithub.com\u002Fdavidanthonyn\u002Fclaude-skills\u002Fblob\u002Fmain\u002Fyoutube-downloader\u002FSKILL.md",[],[],{"skillNo":83,"name":84,"nameZh":6,"description":85,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":86,"categories":87,"keywords":88,"publishedAt":18},"01M7AQJQSD2H04EE2EPNAQ8A3M","wordpress-plugin-core","This skill provides comprehensive knowledge for WordPress plugin development, covering core patterns, security best practices, database interactions, hooks\u002Ffilters, Settings API, custom post types, REST API, and AJAX. This skill should be used when creating WordPress plugins, troubleshooting security issues, implementing custom post types\u002Ftaxonomies, building admin interfaces, or working with the WordPress database.\n\nUse when: Creating new WordPress plugins, implementing nonces\u002Fsanitization\u002Fescaping, working with $wpdb and prepared statements, building Settings API pages, registering custom post types or taxonomies, implementing REST API endpoints, handling AJAX requests, debugging plugin activation\u002Fdeactivation issues, preventing SQL injection\u002FXSS\u002FCSRF vulnerabilities.\n\nKeywords: wordpress plugin development, wordpress security, wordpress hooks, wordpress filters, wordpress database, wpdb prepare, sanitize_text_field, esc_html, wp_nonce, custom post type, register_post_type, settings api, rest api, admin-ajax, wordpress sql injection, wordpress xss, wordpress csrf, plugin header, activation hook, deactivation hook, wordpress coding standards, wordpress plugin architecture","https:\u002F\u002Fgithub.com\u002Fdavidanthonyn\u002Fclaude-skills\u002Fblob\u002Fmain\u002Fwordpress-plugin-core\u002FSKILL.md",[],[],{"skillNo":90,"name":91,"nameZh":6,"description":92,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":93,"licenseFileUrl":94,"sourceHtmlUrl":95,"categories":96,"keywords":97,"publishedAt":18},"01M7AQJ91T970QCFMN9R1EHZXV","webapp-testing","Test local web applications with Playwright. Use when asked to verify frontend functionality, debug UI behavior, capture browser screenshots, or inspect browser logs.","Apache-2.0","https:\u002F\u002Fgithub.com\u002Fdavidanthonyn\u002Fclaude-skills\u002Fblob\u002Fmain\u002Fwebapp-testing\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fdavidanthonyn\u002Fclaude-skills\u002Fblob\u002Fmain\u002Fwebapp-testing\u002FSKILL.md",[],[],{"skillNo":99,"name":100,"nameZh":6,"description":101,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":102,"categories":103,"keywords":104,"publishedAt":18},"01M7AQJ5E89MS8C5K3GZTY4B48","web-performance-audit","Audit web performance using Chrome DevTools MCP. Use when asked to audit, profile, debug, or optimize page load performance, Lighthouse scores, or site speed.","https:\u002F\u002Fgithub.com\u002Fdavidanthonyn\u002Fclaude-skills\u002Fblob\u002Fmain\u002Fweb-performance-audit\u002FSKILL.md",[],[]]