=== Meser10 for WooCommerce ===
Contributors: meser10
Tags: woocommerce, email marketing, sms, customers, newsletter
Requires at least: 5.3
Tested up to: 7.1
Requires PHP: 7.2
Stable tag: 1.1.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Sync WooCommerce customers to a Meser 10 contact list when an order completes, with a consent checkbox at checkout and tagging by product.

== Description ==

This plugin connects your WooCommerce store to your [Meser 10](https://www.meser10.co.il/) account. When an order reaches the status you choose, the customer is created or updated as a contact on the mailing list you name - no CSV exports, no manual copying.

= What it does =

* Adds a marketing consent checkbox to the checkout - on both the classic checkout and the block checkout.
* Syncs the customer when the order is marked **processing** or **completed** - you choose which.
* Maps the billing details WooCommerce already collected: email, phone, first and last name, address, city and postcode.
* Optionally tags each customer with the products they bought, one Meser 10 group per product or SKU.
* Never syncs the same order twice, even when an order passes through processing on its way to completed.
* Keeps an optional debug log of requests and responses, stored in the database and visible only to administrators.

= Consent comes first =

By default the plugin syncs **only** customers who ticked the consent checkbox at checkout. You can switch that requirement off, but then every order is synced regardless of what the customer agreed to - make sure that matches your own privacy policy and the law that applies to you.

= External service =

This plugin sends customer data to Meser 10, an email and SMS marketing platform operated by Mesereser Ltd. It is not usable without a Meser 10 account.

**What is sent, and when:** when an order reaches the configured status, the plugin sends the billing email address, phone number, first and last name, street address, city and postcode from that order, together with your API key and the target contact list name. If product tagging is switched on, the names or SKUs of the purchased products are sent as well. Nothing is transmitted while no API key is saved, and nothing is transmitted for an order that does not meet the consent rule you configured.

**Where it is sent:** to the Meser 10 JSON API at `https://heb.mesereser.com/Services/JsonServices.aspx` over HTTPS. Product tagging additionally uses the Meser 10 SOAP API at `https://ns.mesereser.com/Services/Services.asmx`, because the JSON API has no tagging endpoint.

* Terms of use: https://www.meser10.co.il/terms/
* Privacy policy: https://www.meser10.co.il/privacy/

Please make sure your store's privacy policy tells customers that their details are transferred to Meser 10, and that you have a lawful basis for sending them marketing messages.

== Installation ==

1. Install and activate the plugin. WooCommerce must be active.
2. Go to **Meser 10** in the admin menu.
3. Paste the API key from your Meser 10 account (User Settings screen) and enter the name of the contact list new customers should join. The list name must match the one in your Meser 10 account exactly.
4. Choose whether to sync on **processing** or on **completed**, and whether consent is required.
5. Place a test order and check the debug log to confirm the contact was created.

== Frequently Asked Questions ==

= Do I need a Meser 10 account? =

Yes. The plugin is a connector and does nothing without an account and an API key.

= Where does the consent checkbox appear? =

Under the contact details on the checkout. It works on the block checkout used by current WooCommerce versions and on the older classic (shortcode) checkout.

= Which order status should I sync on? =

"Completed" is the safer choice: it avoids syncing orders that later fail payment. "Processing" is earlier and suits digital products that are delivered immediately.

= What does product tagging need? =

A numeric User ID from your Meser 10 account, in addition to the API key. Tagging uses the separate Meser 10 SOAP interface, because the JSON API has no tagging endpoint. Leave the User ID empty and tagging stays off.

= A customer ordered but no contact was created. What should I check? =

In this order: that the API key is saved; that the contact list name matches the list in Meser 10 exactly; that the order reached the status you configured; and that the customer ticked the consent checkbox, if consent is required. Switch on the debug log and the reason will be recorded there.

== Changelog ==

= 1.1.0 =
* Source strings are now English, with a complete Hebrew (he_IL) translation and a .pot file.
* The connection test no longer reports a valid key as a failure. A reply from Meser 10 - any reply - now counts as a working connection; only an unreachable server or a rejected key is shown as an error.
* Plugin renamed to Meser10 for WooCommerce.

= 1.0.1 =
* Fixed: consent given on the block-based checkout was not detected, so orders were skipped as if the customer had declined. WooCommerce stores that field as `_wc_other/meser10-wc/consent`; the plugin now reads it.

= 1.0.0 =
* First release. Order sync on processing or completed, consent checkbox on both checkouts, optional product tagging, debug log.
