=== Got A Sale - Order Notifications for WooCommerce ===
Contributors: gotasale
Tags: woocommerce, notifications, telegram, discord, slack, orders
Requires at least: 5.8
Tested up to: 6.9
Requires PHP: 7.4
Stable tag: 1.1.2
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Send WooCommerce order notifications to Telegram, Discord, and Slack instantly.

== Description ==

Got A Sale sends real-time WooCommerce order notifications to your Telegram chats, Discord channels, and Slack workspaces. Get notified about new orders instantly — wherever you are. Upgrade through the Got A Sale service for additional event types like status changes, low stock alerts, and refunds.

= Features =

* **New Order Notifications** — Get notified the moment a new order is placed
* **Additional Event Types** — Status changes, low stock alerts, and refund notifications (Pro/Agency via the Got A Sale service)
* **Telegram, Discord & Slack** — Connect to any Telegram chat, Discord channel, or Slack workspace with a simple bot command
* **Multi-Destination Routing** — Send notifications to up to 10 destinations (Pro) or unlimited (Agency)
* **Per-Destination Event Filtering** — Choose which events each destination receives (Pro/Agency)
* **Generic Webhooks** — Add webhook URLs for Zapier, Make, n8n, or custom integrations (Pro/Agency)
* **Payload Customisation** — Control which data fields appear in each destination's notifications (Pro/Agency)
* **HPOS Compatible** — Fully compatible with WooCommerce High-Performance Order Storage
* **Lightweight** — No order data stored locally; notifications are sent in real time

= How It Works =

1. Install and activate the plugin
2. Copy your unique Site Token from Settings > Got A Sale
3. Send the token to @gotasale_bot on Telegram, use /link in Discord, or use /gotasale link in Slack
4. Approve the connection in your WordPress admin
5. Start receiving order notifications!

= External Service Usage =

This plugin relies on the Got A Sale notification service to deliver messages to your Telegram, Discord, Slack, and webhook destinations. The plugin communicates with the Got A Sale API server at **api.gotasale.io**.

**Data transmitted to the service:**

* **On activation:** Your site token, store URL, and store name (for registration)
* **On order events:** Order details (ID, status, total, currency, items, customer name, email, phone, addresses) are sent to the Got A Sale server, which routes them to your connected destinations
* **On WC API setup:** Read-write WooCommerce REST API credentials are encrypted (AES-256-GCM) and sent to the server to enable order viewing from the Got A Sale app
* **On upgrade/billing:** You are redirected to Stripe for payment processing. Stripe handles all payment data.

**No order data is stored on Got A Sale servers.** Orders are fetched live from your store via the WooCommerce REST API when viewed in the Got A Sale app.

* [Privacy Policy](https://gotasale.io/privacy)
* [Terms of Service](https://gotasale.io/terms)
* [Got A Sale Website](https://gotasale.io)

== Installation ==

1. Upload the `gotasale` folder to the `/wp-content/plugins/` directory, or install directly from the WordPress plugin repository
2. Activate the plugin through the **Plugins** menu in WordPress
3. Navigate to **Settings > Got A Sale**
4. Copy your Site Token
5. Open @gotasale_bot on Telegram and send `/start YOUR_TOKEN`
6. Or install the gotasale Slack app and type `/gotasale link YOUR_TOKEN` in a channel
7. Return to the plugin settings and approve the pending link request

= Requirements =

* WordPress 5.8 or higher
* WooCommerce 6.0 or higher
* PHP 7.4 or higher

== Frequently Asked Questions ==

= Do I need an account to use Got A Sale? =

No. The free tier works without any account — just install the plugin and connect your bot. An account is only needed if you upgrade to Pro or Agency for additional features.

= Which messaging platforms are supported? =

Telegram, Discord, and Slack are supported on all tiers (including Free). Pro and Agency tiers also support generic webhooks for integration with Zapier, Make, n8n, and custom endpoints. Additional event types (status changes, low stock, refunds) are also available on Pro and Agency tiers.

= Is my data stored externally? =

Order notification data is transmitted through the Got A Sale server to reach your Telegram/Discord/Slack destinations but is **not stored**. WooCommerce API credentials are encrypted with AES-256-GCM and stored on the Got A Sale server solely to enable live order viewing from the Got A Sale app.

= What happens if I deactivate the plugin? =

Notifications will stop being sent. Your destinations remain linked on the Got A Sale server. If you uninstall (delete) the plugin, all local settings and WooCommerce API keys created by the plugin are removed.

= How do I upgrade to Pro or Agency? =

Go to **Settings > Got A Sale** and click **Upgrade to Pro** or **Upgrade to Agency**. You will be redirected to a secure Stripe checkout page. After payment, your tier is upgraded automatically. Advanced features like per-destination event routing, payload customisation, and webhooks can be configured on your [Got A Sale dashboard](https://gotasale.io/dashboard).

= Where do I configure webhooks and per-destination settings? =

Per-destination event routing, payload customisation, and generic webhooks are managed on your [Got A Sale dashboard](https://gotasale.io/dashboard). These features are part of the Got A Sale service and require a Pro or Agency subscription.

= Can I connect multiple stores? =

Yes. Pro supports up to 3 stores and Agency supports unlimited stores. Each store uses its own site token.

= Does it work with WooCommerce HPOS? =

Yes. Got A Sale is fully compatible with WooCommerce High-Performance Order Storage (HPOS).

== Screenshots ==

1. Settings page — branded dashboard with connection status and site token
2. Pending link requests — approve Telegram, Discord, and Slack connections
3. Destinations — manage linked channels with event and field summaries
4. Advanced Features — info section with link to the Got A Sale dashboard for service configuration
5. Plan & Pricing — view current plan and upgrade options

== Changelog ==

= 1.1.2 =
* Fixed PayPal/Afterpay/Klarna sending premature notification before payment confirms
* Fixed empty items in notifications for redirect-based payment gateways
* Reduced duplicate status change notifications with order-level deduplication

= 1.1.1 =
* Fixed notifications not sending for admin-created orders
* Removed local event filtering — all event delivery is now handled by the server
* Added woocommerce_new_order hook for broader order capture

= 1.1.0 =
* Moved per-destination event routing, payload customisation, and webhook management to the Got A Sale dashboard
* Added Advanced Features info section with link to the dashboard
* Removed local event blocking — the server now handles all tier-based filtering
* Fixed text domain to match plugin slug (got-a-sale)
* Restyled Plan & Pricing section

= 1.0.2 =
* Added Slack as a supported notification platform
* Slack connect guide in plugin settings with "Add to Slack" button
* Updated pricing tier feature lists to include Slack

= 1.0.1 =
* Removed global event toggles section (per-destination routing is the preferred method)
* Added license key activation for paid tiers

= 1.0.0 =
* Initial release
* Telegram, Discord, and Slack notification support
* New order, status change, and low stock event types
* Multi-destination routing (Pro/Agency)
* Per-destination event filtering (Pro/Agency)
* Generic webhook support with HMAC-SHA256 signing (Pro/Agency)
* Payload field customisation per destination (Pro/Agency)
* WooCommerce HPOS compatibility
* Notification deduplication to prevent spam during bulk operations

== Upgrade Notice ==

= 1.1.2 =
Fixed notifications firing prematurely for PayPal and other redirect-based payment gateways. Orders now notify only after payment is confirmed.

= 1.1.1 =
Fixed notifications not sending for admin-created orders.

= 1.1.0 =
Advanced features are now managed on the Got A Sale dashboard. Fixed text domain for translation compatibility.

= 1.0.2 =
Slack is now supported as a notification destination on all tiers. Update to see the Slack connect guide in your settings.

= 1.0.0 =
Initial release. Install to start receiving WooCommerce order notifications on Telegram, Discord, and Slack.
