=== Threadwire for WooCommerce ===
Contributors: tritech
Tags: whatsapp, order updates, woocommerce, notifications
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 7.4
Stable tag: 1.0.2
License: GPLv2 or later

Order updates on WhatsApp, sent only to buyers who ask for them.

== Description ==

After checkout, the thank-you page and the order email show "Get order updates on WhatsApp". The button opens WhatsApp with a message about the order already typed. Once the buyer sends it, the order is linked to their chat, they get a confirmation, and each status you choose (processing, completed, cancelled…) sends them a message.

Why the buyer writes first: WhatsApp bans numbers that message people who never wrote to them. Here every update is a reply in a chat the buyer started, so your number stays safe and updates are not limited as first messages. An update goes only to the phone that asked, from the number it wrote to, within 30 days of their message; after that the order notes say why none was sent.

You need a Threadwire account with a linked WhatsApp number (an instance): https://threadwire.net

== Installation ==

1. Upload the plugin (Plugins → Add New → Upload) and activate it. WooCommerce must be active.
2. In your Threadwire panel, make an API key that may send (Developers → API keys, admins only), and copy the Instance ID from the instance's page (Instances).
3. In Threadwire, under Developers → Webhooks, set the webhook URL to the address shown in WooCommerce → Settings → WhatsApp, and copy the signing secret. Leave the events as they are: the plugin reads only "message.received" and ignores the rest, and the events are one list for your whole account, so un-ticking the others would switch them off for every other system too. To keep your account's webhook URL for another system, set this as the instance's own webhook URL on its page instead, and copy that instance's signing secret.
4. In WooCommerce → Settings → WhatsApp, fill in the key, the Instance ID and the secret, and write the message for each order status (leave one empty to send nothing for it).

== Frequently Asked Questions ==

= Does it message buyers who did not tap the button? =

No. Only buyers who wrote to your number about their order get updates.

= What can the messages say? =

Any text, with {first_name}, {order_number}, {total}, {status} and {site_name} filled in.

= Can someone else claim an order? =

No. The reference in the message is checked with a secret only your shop has, and the first phone to send it keeps the order; another phone sending it is noted on the order and ignored. Staff can stop updates for an order from its Order actions.

= What if a buyer wants to stop? =

They reply STOP. Threadwire then sends them nothing more until they write again.

== Changelog ==

= 1.0.2 =
* Threadwire's address is threadwire.net: it is the default "API address" now. The former address keeps working, so a shop already set up needs no change.

= 1.0.1 =
* Fixed: the settings file had a syntax error, so the plugin could not be loaded.
* Setup: leave your Threadwire events as they are, instead of choosing only "message.received"; "Number ID" is now "Instance ID".

= 1.0.0 =
* First release: the opt-in button, signed webhook, confirmation and status updates.
