=== MountDev Email Delivery for Cloudflare ===
Contributors: cascadiawebservices
Tags: email, smtp, cloudflare, wp_mail, email log
Requires at least: 5.7
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Route all WordPress email through Cloudflare Email Service, send test emails, and keep a searchable log with configurable retention.

== Description ==

MountDev Email Delivery for Cloudflare replaces the default WordPress `wp_mail()` transport with Cloudflare Email Service. Once you enter your Cloudflare Account ID and API token and enable the plugin, every email your site sends — from WordPress core, themes, and other plugins — is delivered through Cloudflare's REST API.

Features:

* **Cloudflare Email Service integration** — deliver mail via Cloudflare's Email Sending REST API.
* **Drop-in wp_mail() replacement** — works like WP Mail SMTP / Fluent SMTP; no code changes needed in other plugins.
* **Send a test email** — pick a From and To address and verify delivery from the admin screen.
* **Email logging** — every message is recorded with recipients, subject, body, status, and the provider response.
* **Retention rules** — automatically prune old logs after 7, 14, 30, 60, 90, 180, or 365 days, or keep them forever. Default is 30 days.
* **Encrypted credentials** — your Cloudflare API token is encrypted at rest.

Requirements: a Cloudflare account using Cloudflare DNS, with a sender domain onboarded for Email Sending, and an API token with the Email Sending permission.

Full setup documentation: https://cascadiawebservices.com/products/email-delivery-for-cloudflare

== Installation ==

1. Upload the `mountdev-email-delivery-for-cloudflare` folder to `/wp-content/plugins/`, or install the ZIP through Plugins → Add New.
2. Activate the plugin through the Plugins menu in WordPress.
3. Go to Settings → Email Delivery.
4. Enter your Cloudflare Account ID, API token, and default From address, then enable sending.
5. Use the Send Test tab to confirm delivery.

== Frequently Asked Questions ==

= Does this work with other plugins that send email? =

Yes. It hooks the `pre_wp_mail` filter, so any email sent through the standard `wp_mail()` function is routed through Cloudflare.

= Where do I get a Cloudflare API token? =

In the Cloudflare dashboard, create an API token with permission to use Email Sending for your account, and copy your Account ID from the account overview.

= How long are logs kept? =

By default, 30 days. You can choose 7, 14, 30, 60, 90, 180, 365 days, or keep logs forever, on the Settings tab.

== External services ==

This plugin connects to the Cloudflare Email Service (Cloudflare's Email Sending REST API) to deliver your site's outgoing email. This connection is required for the plugin to function: when enabled, the plugin replaces WordPress' built-in mail transport and hands every outgoing message to Cloudflare for delivery. The service is provided by Cloudflare, Inc.

What data is sent, and when:

* Data is sent only while the plugin is enabled and configured with your Cloudflare Account ID and API token. When the plugin is disabled or not yet configured, nothing is sent to Cloudflare and WordPress sends email normally.
* A request is sent to Cloudflare each time your site sends an email. This includes email generated by WordPress core, your theme, and other plugins through the standard `wp_mail()` function, as well as the manual "Send Test" and "Resend" actions on the plugin's admin screens.
* Each request transmits the message and the information required to deliver it: the From, To, Cc, and Bcc addresses; the subject; the message body (HTML and/or plain text); any custom email headers; and any file attachments included with the message. Your Cloudflare Account ID and API token are also sent, to authenticate the request.
* Requests are sent to Cloudflare's API endpoint at https://api.cloudflare.com.

This plugin does not send your data to any other third party.

Cloudflare's legal terms:

* Terms of Use: https://www.cloudflare.com/terms/
* Privacy Policy: https://www.cloudflare.com/privacypolicy/

== Changelog ==

= 1.0.0 =
* Initial scaffold: settings, test email, email logging, retention, and wp_mail() replacement wiring.

== License ==

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2, as published by the Free Software Foundation.
