reusser/craft-cloudflare-email
Composer 安装命令:
composer require reusser/craft-cloudflare-email
包简介
Cloudflare Email Sending integration for Craft CMS
README 文档
README
Cloudflare Email for Craft CMS
This plugin provides a Cloudflare Email Sending integration for Craft CMS.
Requirements
- Craft CMS 4.0.0+ or 5.0.0+
- PHP 8.0.2+ (Craft 4) or PHP 8.2+ (Craft 5)
- A Cloudflare account with Email Sending enabled on a verified domain
Installation
From the Plugin Store
Go to the Plugin Store in your project’s Control Panel and search for “Cloudflare Email”. Then click on the “Install” button in its modal window.
With Composer
cd /path/to/my-project.test
composer require reusser/cloudflare-email
./craft plugin/install cloudflare-email
Prerequisites
Before installing this plugin, onboard your sending domain in Cloudflare following Cloudflare's official guide:
➡️ Get started with Cloudflare Email Sending
That walks you through enabling Email Sending on a domain, adding the required SPF/DKIM/DMARC records, and finding your Account ID and API token.
Setup
- Create a Cloudflare API token with the Email Sending permission scoped to your account. You can do this from your Cloudflare dashboard under My Profile → API Tokens → Create Token → Custom token.
- In Craft, go to Settings → Email.
- Set the Transport Type to Cloudflare Email.
- Enter your Account ID and API Token.
- Save and send a test email.
Environment variables (recommended)
Both fields support environment variables. Add the following to your .env file:
CLOUDFLARE_ACCOUNT_ID="your-account-id"
CLOUDFLARE_API_TOKEN="your-api-token"
Then enter $CLOUDFLARE_ACCOUNT_ID and $CLOUDFLARE_API_TOKEN in the corresponding settings fields.
See Environmental Configuration in the Craft docs for more on environment variables.
How it works
Mail is sent via Cloudflare’s API:
POST https://api.cloudflare.com/client/v4/accounts/{account_id}/email/sending/send
Authorization: Bearer {token}
Accept: application/json
The transport translates Symfony’s Email object into Cloudflare’s expected JSON payload, including support for:
from,to,cc,bcc,reply_to- HTML and plain-text bodies
- Custom headers
- Attachments (base64-encoded)
Errors returned by Cloudflare are surfaced as Symfony TransportExceptions.
Troubleshooting
invalid_request_schemaerrors — the most common cause is an unverified sender domain or an address that isn’t allowed by your Cloudflare Email Sending configuration.- 401 Unauthorized — verify the API token has the Email Sending permission and is scoped to the correct account.
- No emails arriving — check Cloudflare’s Email Sending dashboard for delivery and bounce status.
Development
composer test # run Pest tests composer phpstan # static analysis composer format # apply Pint formatting composer check-format # CI-friendly format check
License
reusser/craft-cloudflare-email 适用场景与选型建议
reusser/craft-cloudflare-email 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 05 月 14 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「mailer」 「email」 「cms」 「cloudflare」 「yii2」 「craftcms」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 reusser/craft-cloudflare-email 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 reusser/craft-cloudflare-email 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 reusser/craft-cloudflare-email 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
GraphQL authentication for your headless Craft CMS applications.
Set Links with a specific language parameter
Supercharged text field validation.
Creates new sare mail transport for laravel applications
Extensible library for building notifications and sending them via different delivery channels.
Email+ extends Kirby's email capabilities by adding support for multiple email services using the same Kirby email API.
统计信息
- 总下载量: 1
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 55
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-05-14