=== Maileroo Mailer ===
Contributors: maileroo
Author: Maileroo
Author URI: https://www.maileroo.com
Plugin URI: https://www.maileroo.com
Tags: smtp, email, maileroo, transactional email, email log
Requires at least: 6.4
Tested up to: 6.9
Requires PHP: 8.1
Stable tag: 1.0.3
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Deliver every WordPress email through Maileroo — Email API v2 or SMTP relay — with logs, delivery tracking, scheduling and templates.

== Description ==

Maileroo Mailer replaces WordPress' default PHP mail() with Maileroo's transactional email infrastructure.

**Two transports**

* **Email API (recommended)** — sends through `https://smtp.maileroo.com/api/v2` over HTTPS. Supports CC/BCC/Reply-To, attachments (incl. inline `cid:` images), custom headers, tags, open/click tracking, Maileroo templates and scheduled sending.
* **SMTP relay** — authenticated SMTP to `smtp.maileroo.com` on ports 587, 465 or 2525.

**Features**

* Modern dashboard: 30-day stats, 14-day volume chart, status breakdown, setup checklist
* Email log with search, filters, HTML preview, event timeline, resend, bulk delete and CSV export
* Webhook endpoint (HMAC-SHA256 verified) that updates each email as delivered, opened, clicked, deferred, failed, rejected or complained
* Compose & send emails from wp-admin, including Maileroo templates and scheduling
* View and cancel scheduled emails
* Automatic fallback to SMTP or PHP mail() if the API is unreachable
* Force From email / name, default Reply-To, default tags, auto plain-text alternative
* Secrets encrypted at rest (AES-256-GCM) or defined in wp-config.php
* Detects which plugin/theme sent each email
* Log retention with daily cleanup; WP dashboard widget; failure notices

**Developer headers** (work on any `wp_mail()` call when using the Email API):

    X-Maileroo-Template-Id: 123
    X-Maileroo-Template-Data: {"first_name":"Jane"}
    X-Maileroo-Scheduled-At: 2026-12-01T09:00:00Z   (or "in 2 hours")
    X-Maileroo-Tags: campaign=welcome; source=signup
    X-Maileroo-Tracking: on

**Filters & actions**

* `maileroo_mailer_payload` — modify the API payload `( $payload, $mail, $endpoint )`
* `maileroo_mailer_api_timeout` — HTTP timeout (default 20s)
* `maileroo_mailer_max_attachment_bytes` — total attachment cap (default 20 MB)
* `maileroo_mailer_capability` — capability required for the admin (default `manage_options`)
* `maileroo_mailer_sent`, `maileroo_mailer_failed`, `maileroo_mailer_webhook_event`, `maileroo_mailer_phpmailer_configured`

== Installation ==

1. Upload the `maileroo-mailer` folder to `/wp-content/plugins/` or upload the zip via Plugins → Add New → Upload.
2. Activate the plugin. You'll land on Maileroo → Settings.
3. Choose **Maileroo Email API**, paste your sending key (Maileroo → Email API → Domains → your domain → Sending Keys) and click **Test connection**.
4. Set a From email on your verified domain and save.
5. Optional: add the webhook URL shown in Settings to Maileroo and paste its shared secret to enable delivery tracking.
6. Send a test from Maileroo → Send Email.

== wp-config.php constants ==

    define( 'MAILEROO_MAILER', 'api' );            // api | smtp | none
    define( 'MAILEROO_API_KEY', '...' );
    define( 'MAILEROO_SMTP_USERNAME', '...' );
    define( 'MAILEROO_SMTP_PASSWORD', '...' );
    define( 'MAILEROO_SMTP_PORT', 587 );
    define( 'MAILEROO_FROM_EMAIL', 'hello@example.com' );
    define( 'MAILEROO_FROM_NAME', 'My Site' );
    define( 'MAILEROO_WEBHOOK_SECRET', '...' );
    define( 'MAILEROO_ENCRYPTION_KEY', '...' );    // optional custom key for secret encryption

== Copyright ==

Maileroo Group Pty Ltd
ABN 39 691 482 836
Level 14
333 Collins Street
Melbourne VIC 3000
Australia

Maileroo® is a registered trademark in Australia. Trade Mark No. 2591653. All brand assets are copyrighted by Maileroo Group Pty Ltd.

== Changelog ==

= 1.0.3 =
* Plugin author and links updated to Maileroo.

= 1.0.2 =
* Maileroo logo in header and footer; Maileroo Group Pty Ltd legal footer and copyright.

= 1.0.1 =
* Redesigned footer; full-width responsive layout; cache-busted admin assets.

= 1.0.0 =
* Initial release.
