=== SmartMailer: rozesílka newsletterů a e-mailing pro WordPress ===
Contributors: dominikshaim
Tags: newsletter, rozesílka, e-mailing, email marketing, woocommerce
Requires at least: 6.2
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.2.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Rozesílka newsletterů a e-mailing pro WordPress a WooCommerce. Kontakty se do SmartMailer.cz synchronizují automaticky, jakmile vzniknou.

== Description ==

SmartMailer connects your WordPress site to the **SmartMailer.cz** e-mail marketing service. Once configured, new contacts are sent to your SmartMailer address book automatically, at the moment they are created on your site. Contacts are sent immediately; campaign conversions use the hourly WP-Cron event or the protected cron URL shown in settings.

SmartMailer is part of **WooModuly.cz**, a collection of WordPress and WooCommerce plugins, see https://woomoduly.cz/produkt/smartmailer/.

Contacts are collected from:

* **WordPress**: new user accounts and comment authors
* **WooCommerce**: customers from new orders (billing name and e-mail)
* **Contact Form 7**: submitted form entries (with per-form field mapping)
* **WPForms**: submitted form entries (with per-form field mapping)

Each integration is opt-in and disabled by default. Nothing is transmitted until you enter a valid API token and turn an integration on.

Contacts are **not** sent retroactively, only from the moment you set the plugin up. To import existing WordPress and WooCommerce contacts, the plugin can generate a CSV file that you import in the SmartMailer administration.

This plugin requires a SmartMailer.cz account. SmartMailer.cz is a third-party service; see the *External services* section below.

Campaign links use `?id_smartmailer=<campaign UUID>`. The last campaign click is kept for 365 days by default. With WP Consent API installed, the marketing category must be allowed before the cookie is stored or used. A qualifying WooCommerce order sends its campaign UUID and an anonymous, stable order identifier to SmartMailer. No order amount or customer data is included in conversion requests.

On a new installation, only contacts with marketing consent are sent. Registration and WooCommerce checkout show an optional checkbox. In Contact Form 7 and WPForms, map the consent checkbox to `CONSENT`. Comments have no consent field and are skipped when this option is on. Updates keep the previous contact transfer behavior and display a reminder in settings.

== Installation ==

1. Upload the `smartmailer` folder to the `/wp-content/plugins/` directory, or install the plugin through the **Plugins** screen in WordPress.
2. Activate the plugin through the **Plugins** screen.
3. Open **SmartMailer** in the admin menu.
4. Enter your **API token** (SmartMailer administration → Settings → API → Generate) and the **address book UUID**.
5. Enable the integrations you want (WordPress, WooCommerce, Contact Form 7, WPForms).

== Frequently Asked Questions ==

= Do I need a SmartMailer.cz account? =

Yes. The plugin synchronises contacts into a SmartMailer.cz address book and requires an API token from your SmartMailer account.

= Are existing contacts imported automatically? =

No. Synchronisation starts when you enable an integration. For existing WordPress and WooCommerce contacts, use the CSV export and import it in SmartMailer.

= Does the plugin work without WooCommerce? =

Yes. WooCommerce, Contact Form 7 and WPForms integrations appear only when those plugins are active.

== External services ==

This plugin connects to the **SmartMailer.cz** e-mail marketing service to synchronise your contacts. The connection is required for the plugin's core functionality.

When an integration is enabled, the plugin sends contact data (**first name, last name and e-mail address**) to the SmartMailer API at the moment a contact is created on your site (a user registers, a comment is posted, a WooCommerce order is placed, or a Contact Form 7 / WPForms form is submitted). Requests are made over HTTPS and authenticated with the API token you enter in the settings.

No data is sent until you enter a valid API token and enable at least one integration. The CSV export feature generates a file for download in your browser and does **not** transmit data to SmartMailer.

* Service provider: SmartMailer.cz (https://smartmailer.cz)
* API endpoint: https://smartmailer.cz/api/v1/
* Terms of Service: https://smartmailer.cz/obchodni-podminky
* Privacy Policy: https://smartmailer.cz/zasady-ochrany-osobnich-udaju

== Screenshots ==

1. SmartMailer settings: enter your API token and address-book UUID, then switch on the integrations you want (WordPress, WooCommerce, Contact Form 7, WPForms). Each integration is opt-in, and existing contacts can be exported to CSV.
2. Per-form field mapping: map each Contact Form 7 (or WPForms) form field to a SmartMailer address-book field.
3. SmartMailer.cz: your address books. Contacts synced by this plugin land in the address book identified by the UUID you enter in the settings.
4. SmartMailer.cz: dashboard overview with total contacts, e-mails sent and campaign statistics (delivered, opened, clicked).
5. SmartMailer.cz: drag-and-drop newsletter editor used to design and send campaigns to the contacts you collect.

== Changelog ==

= 1.2.0 =
* Campaign attribution and WooCommerce conversion tracking with configurable order statuses, cookie lifetime and first-order attribution.
* Stable anonymous conversion IDs, batching and retries after API errors.
* Marketing consent for accounts, checkout and mapped Contact Form 7 / WPForms fields. Enabled by default on new installations; existing settings are preserved.
* Users created through WP-CLI are also synchronised with SmartMailer according to the configured consent settings.


= 1.1.9 =
* Contact Form 7 and WPForms field mappings saved by the older self-hosted version of the plugin are carried over once after the update; mappings filled in since then are kept.
* Comments marked as spam or moved to the trash are no longer sent to SmartMailer.

= 1.1.8 =
* Admin page titles, texts and translations use a colon instead of long dashes.

= 1.1.7 =
* Fix contact e-mail fields and per-form mapping for WordPress, Contact Form 7 and WPForms.
* Serialize multi-value form fields for the API, preserve bulk-delete payload compatibility and clean up per-form settings on uninstall.

= 1.1.6 =
* The plugin page now links to WooModuly.cz, the WordPress and WooCommerce plugin collection this plugin is part of.

= 1.1.5 =
* Full internationalization: English source strings + bundled Czech and Slovak translations (text domain `smartmailer`).

= 1.1.4 =
* Rewritten to native WordPress; removed the bundled Nette and Latte libraries (smaller footprint, no dependency conflicts).
* Removed the self-hosted updater; updates are now delivered through WordPress.org.
* Prepared for the WordPress.org plugin directory: GPL license, readme and external-service disclosure.

= 1.1.3 =
* Hardening: access-control, nonce and capability checks on the data export; CSV formula-injection protection; request timeouts on API calls.

= 1.1.2 =
* Maintenance release.
