=== WhatSell CRM for WooCommerce ===
Contributors: xpertgroup
Tags: woocommerce, whatsapp, notifications, order updates, crm
Requires at least: 6.6
Tested up to: 6.8
Requires PHP: 8.0
WC requires at least: 9.3
Stable tag: 1.1.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Send WhatsApp order confirmations and shipping updates to your WooCommerce customers through WhatSell CRM.

== Description ==

WhatSell CRM for WooCommerce sends an approved WhatsApp template to your customer:

* when an order is received (status Processing), and
* when an order is completed (status Completed).

Messages are sent from your own WhatsApp Business number through your WhatSell CRM account (https://app.whatsell.ai). Each message is sent once per order, and the settings page shows the last 20 messages and their status.

The template receives two values: {{1}} = the customer's first name and {{2}} = the order number. Ready-made templates written for Meta approval are in the WhatSell CRM template library.

Compatible with WooCommerce High-Performance Order Storage (HPOS).

= Data sent =

To deliver a message the plugin sends the customer's first name, order number and phone number to WhatSell CRM (app.whatsell.ai), operated by Xpert Group FZE-LLC. Privacy policy: https://app.whatsell.ai/view/privacy-policy. Tell your customers in your own privacy policy that order updates are sent on WhatsApp.

== Installation ==

1. In WordPress go to Plugins → Add New → Upload Plugin, choose the ZIP and click Install Now, then Activate.
   Updating from 1.0.x: upload the ZIP and choose "Replace current with uploaded". Your settings are kept.
2. Open WhatSell CRM in the WordPress menu.
3. Paste your WhatSell CRM API key (WhatSell CRM → API access) and your default country code.
4. Turn on the messages you want and enter the exact name of an approved template for each.
5. Use "Send test" to check a message reaches your phone.

== Frequently Asked Questions ==

= Which templates can I use? =
Any approved template in your WhatSell CRM account that uses {{1}} for the name and {{2}} for the order number.

= A customer did not get a message. Why? =
Check "Recent messages" on the settings page. "Skipped" means the order had no usable phone number; "Failed" shows the reason when you hover over it. Also check that the template is approved and that your WhatsApp number is connected in WhatSell CRM.

= Who pays for the messages? =
Meta charges per message to your WhatsApp Business account. See https://app.whatsell.ai/pricing#calculator.

== Changelog ==

= 1.1.0 =
* Renamed to WhatSell CRM for WooCommerce, with a new settings page.
* Security: removed the public webhook endpoint and the unauthenticated OAuth key creation of 1.0.x, and deletes what they left behind.
* Security: the API key is sent only in the Authorization header and is no longer shown on the settings page; the log file in the plugin folder is removed.
* Orders without a phone number are skipped instead of being sent to a fallback number.
* Each message is sent once per order; order and shipping messages no longer overwrite each other in the log.
* A failed API response is now recorded as failed.
* Default country code for local phone numbers, "Send test" button, recent messages table.

= 1.0.1 =
* Configurable CRM API URL and sanitising.

= 1.0.0 =
* First release.
