=== SuperIntech Mailer ===
Contributors: superintech
Tags: smtp, mailgun, sendgrid, wp_mail, email, deliverability, mail log
Requires at least: 5.8
Tested up to: 6.8
Requires PHP: 7.4
Stable tag: 1.7.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Routes every outgoing WordPress email through SMTP, Mailgun or SendGrid, with logging, retry/failover and a test tool.

== Description ==

SuperIntech Mailer is a drop-in mail transport layer. Any plugin that sends mail via the standard `wp_mail()` function — contact forms, WooCommerce, booking and lead plugins — is automatically delivered through the provider you configure. No changes are required in those plugins.

Features:

* Providers: SuperIntech Cloud (managed relay — one API key, no third-party account), SMTP, Mailgun (HTTP API, US/EU), SendGrid (HTTP API). Pluggable architecture — add a provider with one class.
* Force From name and From email site-wide (optional).
* Email logging with status, provider and error, filterable, auto-purged after a configurable retention window. Body capture is opt-in.
* Retry / failover to a backup provider when the primary fails (API providers).
* Built-in test email and connection test.
* Secrets encrypted at rest (AES-256). Optionally define credentials as wp-config.php constants to keep them out of the database.
* Warns when another SMTP plugin is active to avoid double-hooking.

== Installation ==

1. Upload the `superintech-mailer` folder to `/wp-content/plugins/`, or install the ZIP via Plugins → Add New → Upload.
2. Activate the plugin.
3. Go to **SuperIntech Mailer** in the admin menu.
4. On the **Provider** tab, choose a provider and enter credentials, then Save.
5. Click **Test Saved Connection** to validate.
6. On the **Test** tab, send a test email and confirm it arrives and appears under **Logs**.

== Frequently Asked Questions ==

= Does this work with my contact form / WooCommerce / booking plugin? =
Yes. Anything that uses `wp_mail()` is routed automatically.

= Where are API keys and passwords stored? =
Encrypted in the database (AES-256-CBC, keyed from your WordPress salts), or in wp-config.php constants if you prefer. They are never shown in plaintext in the UI.

= Can I keep credentials out of the database entirely? =
Yes. Define `SUPERINTECH_MAILER_SMTP_PASS`, `SUPERINTECH_MAILER_MAILGUN_KEY` or `SUPERINTECH_MAILER_SENDGRID_KEY` in wp-config.php. The matching field locks in the UI.

== Changelog ==

= 1.7.4 =
* Hardening: mail hooks are wrapped in try/catch and fail open, so the plugin can never cause a site-wide critical error even if another mailer is active.

= 1.7.3 =
* UI: Mode options shown with short names ("Email + WhatsApp" / "Only WhatsApp") and a Recommended tag.

= 1.7.2 =
* UI: Lead Settings polished — toggle shown as a clean settings row, form checklist tidied.

= 1.7.1 =
* UI: form-filter and mode radios restyled as clean selectable option pills (selected one highlighted).

= 1.7.0 =
* New: "WhatsApp only" mode (Connection tab) — for sites that already use SMTP/Mailgun for email. SuperIntech leaves email delivery untouched (no clash) and only sends WhatsApp lead notifications.

= 1.6.1 =
* New: conflicting mail/SMTP plugin detection with a one-click "Deactivate" button, so only SuperIntech Mailer runs (avoids clashes with WP Mail SMTP, FluentSMTP, etc.).

= 1.6.0 =
* New: WhatsApp form filter — choose "All forms" or only specific forms to send to WhatsApp (detects Contact Form 7, WPForms, Gravity Forms, Elementor, and any form after its first submission). Each lead now shows which form it came from. Email delivery is unaffected.

= 1.5.2 =
* Removed the "How It Works" card from the Tools tab.

= 1.5.1 =
* UI polish: larger dashboard stat-card icons; quick-action tiles redesigned (icon on top, centered); fixed Connect WhatsApp button icon; centered the WhatsApp QR block and removed the redundant status line; "How It Works" shown as an icon-topped info card.

= 1.5.0 =
* New: first-run Setup Wizard (Connect → Test → WhatsApp → Done) that launches on activation.
* UI: WhatsApp tab redesigned into clean Connection + Lead Settings cards; smoother dashboard sparkline tooltip that no longer clips at the chart edge.

= 1.4.1 =
* New: click any log row to view full email details (to, subject, body, provider response) and Resend it. Redesigned the Logs toolbar/table (clean filter bar, status badges, empty state, pagination).
* UI: dashboard sparkline now has a styled hover tooltip; fixed the ghost button styling (no underline).

= 1.4.0 =
* New: Dashboard overview tab (now the landing screen) — connection status, emails sent/failed this month, a 14-day volume sparkline, live relay quota, WhatsApp status, and quick actions.

= 1.3.2 =
* UI fixes: toggle switches render as a clean circle (removed WP's stray checkmark glyph); primary buttons are correctly sized (no longer oversized).

= 1.3.1 =
* UI: always-light, higher-contrast theme (no more dark-on-dark on WP dark admin schemes); clearer section headings.

= 1.3.0 =
* Redesigned admin UI: branded header with live status pill, left vertical tab rail, card layout, toggle switches, masked API key with show/hide + copy, and a save toast. All styles scoped to the plugin page.
* Simplified to SuperIntech Cloud only — removed the SMTP/Mailgun/SendGrid and Failover options from the UI (clients just paste their API key).

= 1.2.3 =
* New: "Copy to Connected WhatsApp" toggle on the WhatsApp tab. On = both the connected WhatsApp and the forward number get leads; Off = only the forward number. Forward number equal to the connected number no longer double-sends.

= 1.2.2 =
* New: optional "Forward to Number" on the WhatsApp tab — also send each lead to an extra WhatsApp number (e.g. a manager) from the connected account, in addition to the connected WhatsApp itself.

= 1.2.1 =
* WhatsApp tab now includes the Business Name field (shown atop each WhatsApp lead), sent with every submission. WhatsApp setup lives entirely in the plugin.

= 1.2.0 =
* New: WhatsApp tab — connect this site's own WhatsApp by scanning a QR code, and receive every form submission as a WhatsApp message. Linking is proxied through the relay (API key stays server-side).

= 1.1.1 =
* SuperIntech Cloud endpoint now points to the live relay (https://relay.superintech.com/api/v1/send). Existing installs auto-migrate from the pre-launch placeholder URL.

= 1.1.0 =
* New: "SuperIntech Cloud" provider — customers paste a single SuperIntech-issued API key and mail is delivered through the managed SuperIntech relay, with no SMTP server or third-party account. Set as the recommended provider.

= 1.0.1 =
* Fix: the plugin no longer hijacks wp_mail when the active provider is not fully configured, so installing it without credentials cannot break a site whose default mail works.
* Improve: the Test tab and a page banner now clearly state when no provider is configured instead of returning a generic failure.

= 1.0.0 =
* Initial release: SMTP, Mailgun and SendGrid providers; logging; failover; test tools; encrypted secrets; constant overrides.
