=== eusend ===
Contributors: eusend
Tags: smtp, email, transactional email, wp_mail, gdpr
Requires at least: 6.4
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Send every WordPress email through eusend's EU-native API, and see what actually happened to it — delivered, bounced, opened or refused.

== Description ==

WordPress sends mail with PHP's `mail()` function. It is unauthenticated, it fails
SPF and DKIM, and receiving servers routinely drop it without telling anyone. Password
resets never arrive. WooCommerce receipts go missing. Nobody finds out until a customer
complains.

This plugin replaces that path. Every `wp_mail()` call — core, WooCommerce, Contact
Form 7, Gravity Forms, your theme, anything — is sent through the
[eusend](https://eusend.dev) API instead, DKIM-signed, from infrastructure that sits in
the EU and stores nothing outside it.

= What makes this different from the other mail plugins =

Most of them stop at "handed to the provider". This one records what happened next.

Turn on delivery events and eusend posts back to your site as each message moves:
delivered, bounced, marked as spam, opened, clicked. The log stops being a list of send
attempts and becomes an answer to the question you actually have — *did the customer get
their receipt?* — with the receiving server's own words when the answer is no.

= Features =

* Replaces `wp_mail()` through the `pre_wp_mail` filter — no SMTP connection, no port 465 blocked by your host, works on serverless and locked-down hosting.
* **Real delivery status.** Delivered, bounced, complained, opened and clicked, recorded against each message, with the bounce reason the receiving server gave.
* **Knows who sent what.** The log names the plugin or theme that called `wp_mail()`, so you can tell a WooCommerce receipt from a form notification at a glance.
* **Domain verification checked in place.** The settings screen tells you whether the From domain you typed is actually verified on your account, before you find out by sending.
* **Conflict detection.** Warns when another mail plugin is active, which is the usual reason a correctly-configured mailer appears to do nothing.
* **Site Health integration.** A misconfigured mail setup shows up in Tools → Site Health, where site owners already look.
* Full attachment support, including WordPress 6.3's `array( 'invoice.pdf' => '/tmp/file' )` filename form.
* Cc, Bcc, Reply-To, custom headers and HTML mail, handled the way core handles them.
* Configurable logging — off, failures only, metadata, or metadata plus the message body — with automatic retention.
* Configure from the admin screen, from `wp-config.php` constants, or from environment variables.
* WP-CLI: `wp eusend status`, `wp eusend test`, `wp eusend log`, `wp eusend domains`, `wp eusend events`.
* Filters and actions for developers: `eusend_should_send`, `eusend_email_payload`, `eusend_email_tags`, `eusend_email_sent`, `eusend_webhook_event`.

= Data and privacy =

The plugin talks to `api.eusend.dev`, operated by eusend. Sending an email transmits its
recipients, subject, body, headers and attachments to that API, which is what delivering
it requires. Mail is processed and stored inside the EU.

Enabling delivery events registers this site's REST endpoint on your eusend account and
stores a signing secret locally; every incoming event is verified against it before
anything is written.

The plugin makes no other outbound requests, sends no analytics, and phones nothing home.

* [eusend](https://eusend.dev)
* [Terms](https://eusend.dev/legal/terms) · [Privacy](https://eusend.dev/legal/privacy)

== Installation ==

1. Install and activate the plugin.
2. Add your sending domain at [eusend.dev/domains](https://eusend.dev/domains) and publish the DNS records it gives you.
3. Create an API key at [eusend.dev/api-keys](https://eusend.dev/api-keys).
4. Go to **Settings → eusend**, paste the key, and set the From address to an address on your verified domain.
5. Send a test email from the same screen.

Prefer to keep credentials out of the database? Define them in `wp-config.php` instead —
the settings screen shows those fields as read-only:

`define( 'EUSEND_API_KEY', 'eu_live_…' );`
`define( 'EUSEND_FROM_EMAIL', 'no-reply@yourdomain.com' );`
`define( 'EUSEND_FROM_NAME', 'Your site' );`

Every setting also reads an environment variable of the same name.

== Frequently Asked Questions ==

= Do I need SMTP credentials? =

No. The plugin uses the eusend HTTP API, so nothing depends on outbound port 465 or 587
being open. That is the usual reason SMTP plugins fail on shared and managed hosting.

= What happens if the API is unreachable? =

`wp_mail()` returns false and fires `wp_mail_failed`, exactly as a failed SMTP send does,
and the failure is written to the log with the reason. WordPress core treats that the same
way it treats any mail failure.

= Can I keep another mail plugin installed? =

You can, but don't. Two plugins replacing `wp_mail()` means whichever loads first wins,
silently. The plugin warns you when it detects one.

= Will it send from any address? =

Only from a domain you have verified on your eusend account. That is the point — an
unverified domain is exactly what gets mail discarded. "Force the From address" is on by
default so a plugin that hardcodes its own sender cannot break your sending.

= Does it work with WooCommerce? =

Yes. WooCommerce sends through `wp_mail()`, so order confirmations, invoices and shipping
notices all go through eusend with no extra configuration. Set the WooCommerce "From"
address to your verified domain, or leave "Force the From address" on and it is handled.

= Does it work on multisite? =

Yes. Each site keeps its own settings and its own log. Constants defined in `wp-config.php`
apply across the network.

= Where is my email data stored? =

In the EU. eusend runs entirely on EU infrastructure — that is what it is for.

== Screenshots ==

1. Settings — API key, From address checked against your verified domains, tracking and logging.
2. The email log: what actually happened to every message, and which plugin sent it.
3. One message in detail, with the receiving server's own reason for the bounce.
4. Delivery events, the test send, and a rolling summary of the last seven days.

== Changelog ==

= 1.0.0 =
* First release.
