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

Send WordPress and WooCommerce emails through the ServerSMTP API, with attachments, CC, BCC and delivery logs.

== Description ==

ServerSMTP replaces the default PHP mail transport with the [ServerSMTP](https://serversmtp.ro) transactional email API. Every email sent with `wp_mail()`, including WooCommerce order emails and invoices, is delivered through Amazon SES from your own verified domain, with SPF, DKIM and DMARC alignment.

* Sends HTML and plain-text emails with one Reply-To address.
* Sends attachments, such as WooCommerce PDF invoices: up to 10 files and 10 MB in total. Embedded images are sent as regular attachments.
* Sends CC and BCC, up to 50 recipients in total. Every address counts as one email in your ServerSMTP plan.
* Keeps a short local send history (the last 100 attempts from the last 30 days) with links to the detailed delivery report in ServerSMTP.
* Never retries automatically and never falls back to another transport, so a message is not sent twice.
* No SMTP credentials to manage: the plugin uses an API key, which can also be defined in `wp-config.php`.
* WooCommerce order events (optional): when an order status changes, ServerSMTP receives an event with the customer email, phone and order data, so a ServerSMTP automation can send an email or an SMS (for example "your order has shipped"). Developers can add the courier AWB with the `serversmtp_order_event_data` filter.

A ServerSMTP account with an active subscription and a verified sending domain is required.

The plugin interface is in English and Romanian.

== Installation ==

1. Install and activate the plugin from Plugins > Add New, or upload the zip file.
2. In ServerSMTP, verify your sending domain and create an API key dedicated to this site.
3. In WordPress, open Settings > ServerSMTP. Enter the sender address and the API key, then save.
4. Send a test email and open its report from the send history.
5. Enable "Send WordPress and WooCommerce emails through ServerSMTP" and save. Disable any other plugin that takes over `wp_mail()`.

To keep the key out of the database, define it in `wp-config.php`:

`define( 'SERVERSMTP_API_KEY', 'em_live_...' );`

== Frequently Asked Questions ==

= Do I need a ServerSMTP account? =

Yes. The plugin sends through the ServerSMTP API, which requires an account, an active subscription and a verified sending domain. See [serversmtp.ro](https://serversmtp.ro).

= Can I use it together with another SMTP plugin? =

Use only one transport. Disable the other plugin's mailer, or leave ServerSMTP disabled in its settings.

= Why was an email with an attachment refused? =

Attachments must be readable on the server, not empty, at most 10 files and 10 MB in total, and must not be executable files. The send history and the WordPress `wp_mail_failed` action show the reason.

= Does the plugin store message contents? =

No. The local history stores only the date, subject, initial result and the ServerSMTP request ID. Message bodies, recipients and the API key are never written to the history.

== External services ==

This plugin connects to the ServerSMTP API (`https://api.serversmtp.ro/v1/send`), operated by Think AI SRL, to deliver the emails WordPress sends. It is only used after you enter an API key and enable the transport in Settings > ServerSMTP.

For each email, the plugin sends the sender address, the recipients (To, CC, BCC), the Reply-To address, the subject, the message body and any attachments, together with your API key. Nothing is sent when the transport is disabled.

If you enable WooCommerce order events, the plugin also calls `https://api.serversmtp.ro/v1/events` when an order status you mapped changes. It sends the event name, the customer billing email, the shipping or billing phone, the audience ID and the order number, total, currency, status name and site name. Nothing is sent when order events are disabled.

The service is provided under the ServerSMTP terms of service and privacy policy: [https://serversmtp.ro/legal](https://serversmtp.ro/legal).

== Screenshots ==

1. Settings > ServerSMTP: sender address, API key, test email and send history.

== Changelog ==

= 1.3.0 =
* WooCommerce order events for ServerSMTP email and SMS automations, mapped per order status.

= 1.2.0 =
* English interface with a bundled Romanian translation, ready for WordPress.org.
* Settings link on the Plugins screen. Deleting the plugin removes its settings and local history.

= 1.1.0 =
* Attachments (up to 10 files, 10 MB in total), CC and BCC.

= 1.0.0 =
* First release.

== Upgrade Notice ==

= 1.3.0 =
Adds optional WooCommerce order events for email and SMS automations.

= 1.2.0 =
Adds the English interface and a bundled Romanian translation.
