=== Ultimate Email Logger ===
Contributors: habibiplugins
Tags: email log, email logger, wp mail log, smtp log, email tracking
Requires PHP: 7.4
Requires at least: 6.2
Tested up to: 6.9
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Email log for WordPress. Log, search, resend, forward, export, and track wp_mail emails. All features free, no add-ons.

== Description ==

Ultimate Email Logger records every email your WordPress site sends through `wp_mail()` and stores it in a dedicated database table you can search, view, resend, forward, export, and track.

Works with WooCommerce, Easy Digital Downloads, Contact Form 7, Gravity Forms, WPForms, FluentCRM, LearnDash, BuddyPress, WP Mail SMTP, and any plugin that uses `wp_mail()`.

### Features

* Logs every outgoing email with To, From, CC, BCC, Reply-To, Subject, Body, Headers, Attachments, and Status as dedicated indexed columns.
* Log viewer with sortable columns, date and status filters, full-text search, and predicates: `to:`, `from:`, `cc:`, `subject:`, `id:`.
* Email detail modal with HTML preview, raw text, and JSON tabs.
* Resend any logged email with editable recipient and subject.
* Auto-forward copies of outgoing email via To, CC, or BCC.
* CSV export with field selection, HTML stripping, and custom date format.
* Auto-delete by age (days) or log rotation by count, run on WP Cron.
* Open tracking via 1x1 pixel with open count, timestamp, and user agent.
* Statistics page: summary cards, daily volume chart, top recipients.
* SMTP failure capture via `wp_mail_failed` with stored error message.
* Webhook notifications on failure or for all emails.
* Dashboard widget with today, this week, this month, and failure counts.
* GDPR personal data exporter and eraser.
* REST API under `ultimate-email-logger/v1`.
* Custom capability `manage_email_logs` for role-based access.
* Multisite compatible with per-site tables.
* BuddyPress email logging.
* Translation ready with `.pot` file.

### Performance

Indexed columns and FULLTEXT indexes on subject and body keep search fast. Cleanup runs on WP Cron. Webhooks are non-blocking. Logging adds one indexed insert per email.

== Installation ==

1. Install from the WordPress plugin directory, or upload `ultimate-email-logger` to `/wp-content/plugins/`.
2. Activate the plugin.
3. Open **Email Logger** in the admin sidebar.

Logging starts immediately. No configuration required. Open **Email Logger > Settings** to enable forwarding, auto-delete, open tracking, or webhooks.

== Frequently Asked Questions ==

= Does it log all emails? =
Yes. Every email sent via `wp_mail()` is logged, including WooCommerce, contact forms, and plugin notifications.

= Does it work with SMTP plugins? =
Yes. SMTP plugins like WP Mail SMTP change delivery, not logging. Emails are captured before delivery.

= Can I resend a failed email? =
Yes. Click Resend on any log row. Edit the recipient or subject first if needed.

= Can I export logs? =
Yes. Export to CSV with configurable fields, date format, and optional HTML stripping.

= Is it multisite compatible? =
Yes. Each site has its own log table. Network activation is supported.

= How does open tracking work? =
A 1x1 pixel is added to HTML emails. When the recipient loads images, the open is logged with count, timestamp, and user agent.

= Is it GDPR compliant? =
Yes. The plugin registers with the WordPress personal data exporter and eraser.

= Will it slow my site down? =
No. Logging is a single indexed insert. Cleanup runs on cron. Webhooks are non-blocking.

= What happens on uninstall? =
Data is kept by default. Enable "Remove all data on uninstall" in settings to drop the table, options, cron events, and capabilities.

= Is it really free? =
Yes. All features are included. No pro version, no add-ons.

== Screenshots ==

1. Log viewer with search, filters, sort, and bulk actions.
2. Email detail modal with HTML, Raw, and JSON tabs.
3. Resend modal with HTML body preview.
4. Settings page.
5. Statistics page with daily volume chart.
6. Dashboard widget.

== Changelog ==

= 1.0.0 =
* Initial release.
* Logs every email sent via `wp_mail()` with dedicated columns for To, From, CC, BCC, Reply-To, Subject, Body, Headers, Attachments, and Status.
* React admin UI: sortable log viewer, search predicates, detail modal, resend, CSV export.
* Forwarding, auto-delete (time and count), open tracking, webhooks, statistics.
* REST API, GDPR exporter and eraser, multisite and BuddyPress support, translation ready.

== Upgrade Notice ==

= 1.0.0 =
Initial release.
