=== BundleWP Order Alerts for WooCommerce ===
Contributors: bundlewpofficial
Tags: woocommerce, order notifications, email alerts, smtp, abandoned cart
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.4.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Instant WooCommerce order alerts by email, Telegram & WhatsApp — plus abandoned cart follow-ups and free SMTP settings.

== Description ==

BundleWP Order Alerts tells you the moment something happens in your WooCommerce store — a new order, a failed payment, a cancellation, a completion or a refund — on channels you control yourself. Email alerts are completely free. Telegram and WhatsApp alerts are part of the Pro version: buy the Pro version from bundlewp.com to unlock these platforms — after purchase you receive a license key; paste it in Order Alerts → License to activate. The Pro version is a one-time $19 purchase at https://bundlewp.com/product/bundlewp-order-alerts-for-woocommerce/ — there is no separate download and no subscription. The plugin talks directly to the free Telegram Bot API and to your own Meta WhatsApp Cloud API account, and it can send every WordPress email through your own SMTP account.

The settings live in their own top-level **Order Alerts** menu in the WordPress admin, organised into tabs: Email & SMTP, Telegram, WhatsApp, License, Admin Alerts, Customer Alerts, Cart Follow-ups and Templates.

**What you get**

* **Email alerts** to the store admin email (plus one optional extra recipient), with a built-in **SMTP settings** section so all WordPress email — order mails, password resets, everything — sends through your own mail account for free.
* **Telegram alerts** through the free Telegram Bot API (create a bot with @BotFather in two minutes). *(Pro version — unlocked with a license key.)*
* **WhatsApp alerts** through your own Meta WhatsApp Cloud API app — no third-party gateway and no per-message markup. *(Pro version — unlocked with a license key.)*
* **Events you choose:** new order, pending payment order, on-hold order, failed order, cancelled order, completed order, and refunds (full or partial, with the refund amount and reason).
* **Failed-order and pending-payment alerts always include the customer's pay link**, so you can follow up and recover the sale.
* **High-value order alerts:** set a threshold and get a special alert for big orders — optionally also sent to a second Telegram chat and a second WhatsApp number that receive only these alerts.
* **Daily sales summary:** one message a day (at the time you choose) with the day's order count, total sales and refunds.
* **Review alerts:** get told the moment a product review is approved, with the star rating and review text.
* **Stock alerts:** low-stock and out-of-stock alerts per product (at most one per product every 12 hours, so no spam).
* **Customer alerts with the same event rules as the admin alerts:** optionally message the customer too — order confirmed, pending payment (always with their pay link), order on hold, order completed, order cancelled, refund processed, and failed payment (always with their pay link) — by email and WhatsApp, using its own friendly template. (Telegram stays admin-only.)
* **Abandoned cart follow-ups:** when a customer fills a cart but does not check out, the plugin remembers the cart and follows up on the customer channels — a reminder after the delay you set, a price-drop alert when an item in the cart gets cheaper, and a low-stock alert when an item is about to run out. Each cart gets at most one of each message, and follow-ups stop the moment the customer orders. Tracked carts are listed under **Order Alerts → Pending Carts**.
* **One message template** for all admin channels with placeholders: {site_name}, {order_id}, {status}, {total}, {currency}, {customer_name}, {customer_email}, {items}, {pay_link}, {order_date}, plus a separate customer template and separate cart follow-up templates.
* **Test buttons** for every channel — save your settings, send a test, and know it works before the first real order.
* Duplicate protection: each order event is only ever sent once per order, for admin and customer alerts alike.

**Free email — Telegram & WhatsApp in the Pro version**

* Email alerts (admin alerts, customer alerts and cart follow-ups by email) and the SMTP settings are completely free, forever, with no key and no account.
* Telegram and WhatsApp alerts are part of the **Pro version**. Buy the Pro version from bundlewp.com to unlock these platforms — after purchase you receive a license key; paste it in **Order Alerts → License** to activate. The Pro version is a **one-time $19** purchase at https://bundlewp.com/product/bundlewp-order-alerts-for-woocommerce/ — nothing extra to install, no subscription and no per-message fees from us.
* Telegram's Bot API itself is free to use, and Meta's WhatsApp Cloud API account is free to create; this plugin adds no fees and no markup. (Meta's own pricing rules for conversations may apply to your account, and outside the 24-hour customer service window WhatsApp may require an approved template message.)
* Your license key is verified online when you activate it and about once a day after that. If license verification cannot be reached, the channels keep their last known status — you are never locked out over a temporary outage.

**Private by design**

BundleWP Order Alerts has no tracking and no analytics. Your bot token and API credentials stay in your own WordPress database and are only ever sent to Telegram and Meta when a message is sent. The only other connection is license verification: when you activate a license key or the plugin re-verifies it, the license key, your site's domain and your server's host name are sent for license verification. The external services this plugin connects to are documented in the External services section below.

== External services ==

This plugin connects to the following third-party services, only when you enable them and only with your own accounts and credentials. No data is sent anywhere else: the plugin operates no server of its own and contains no tracking or analytics.

**Telegram Bot API** (api.telegram.org)
This plugin connects to the Telegram Bot API to send alert messages to the store admin's own Telegram chat, using a bot the admin creates with @BotFather. When an enabled order event happens (or the admin clicks the Telegram test button), the plugin sends the admin's bot token (for authentication), the chat ID from the settings, and the message text — which contains order details such as the order number, status, total, customer name and email, and the items bought.
Service terms: https://telegram.org/tos
Privacy policy: https://telegram.org/privacy

**Meta WhatsApp Cloud API** (graph.facebook.com)
This plugin connects to Meta's WhatsApp Cloud API to send alert messages to the admin's own WhatsApp number and, when customer alerts are enabled, to customers' WhatsApp numbers, using the admin's own Meta app. When an enabled event happens (or a test message is sent), the plugin sends the admin's access token (for authentication), the recipient's phone number, and the message text — which contains order details such as the order number, status, total, customer name and email, and the items bought.
Service terms: https://www.whatsapp.com/legal/business-terms
Privacy policy: https://www.facebook.com/privacy/policy

**SMTP email** uses the mail server you configure yourself in the plugin settings (your hosting mailbox, Gmail, or any SMTP provider). Email is sent through your own mail account only; the plugin does not route email through any server of its own.

== Installation ==

1. Upload the `bundlewp-order-alerts` folder to `/wp-content/plugins/`, or install the zip via Plugins → Add New → Upload.
2. Activate the plugin. (WooCommerce must be installed and active.)
3. Go to **Order Alerts** in the WordPress admin menu.
4. Turn on the channels you want:
   * Email: alerts are on by default. Optionally enable SMTP and fill in your mail server details, then send a test email.
   * Telegram and WhatsApp are part of the Pro version: first activate your license key in the **License** tab (buy the Pro version at https://bundlewp.com/product/bundlewp-order-alerts-for-woocommerce/ if you don't have a key yet). Then:
   * Telegram: paste your Bot Token and Chat ID, then send a test message.
   * WhatsApp: paste your Meta Phone Number ID, Access Token and your recipient number (with country code), then send a test message.
5. Choose which order events notify the admin (Admin Alerts tab), adjust the message template if you like (Templates tab), and save.
6. Optional extras: high-value order threshold and the daily sales summary time (Admin Alerts tab), customer alerts with the same event rules (Customer Alerts tab), and abandoned cart follow-ups (Cart Follow-ups tab).

== Frequently Asked Questions ==

= Is BundleWP Order Alerts really free? =

The email alerts are — completely, including SMTP settings, customer alerts and abandoned cart follow-ups by email. Telegram and WhatsApp alerts are part of the Pro version: buy the Pro version from bundlewp.com to unlock these platforms — after purchase you receive a license key that activates them in this same plugin. The Pro version costs $19 one-time at https://bundlewp.com/product/bundlewp-order-alerts-for-woocommerce/ and there is no subscription. The plugin itself is open source (GPLv2), and the channels use the free Telegram Bot API and your own free Meta WhatsApp Cloud API account.

= How does the license key work? =

Buy the Pro version at https://bundlewp.com/product/bundlewp-order-alerts-for-woocommerce/ and you will receive a license key. Paste it under **Order Alerts → License** (or into the box on the locked Telegram / WhatsApp tabs) and click Activate. The plugin verifies the key online and unlocks Telegram and WhatsApp instantly — no extra download. The key is re-checked about once a day; if license verification is temporarily unreachable, the channels keep their last known status instead of locking you out. Deactivate the key on the License tab to free it for another site.

= How do I get a Telegram Bot Token and Chat ID? =

Open Telegram, talk to @BotFather, send /newbot and follow the steps — you get a Bot Token. Then send any message to your new bot, open https://api.telegram.org/botYOUR_TOKEN/getUpdates in a browser, and copy the "chat" → "id" value as your Chat ID.

= How do I get the WhatsApp credentials? =

Create a free app at developers.facebook.com, add the WhatsApp product, and open WhatsApp → API Setup. You will find the Phone Number ID and a temporary Access Token there (create a permanent token with a system user for long-term use). The recipient is your own phone number with country code, digits only.

= Why did my WhatsApp test fail outside business hours? =

WhatsApp only allows free-form text messages inside the 24-hour customer service window (after the recipient has messaged your number). Outside that window, Meta requires an approved template message. Test sends to your own number work after you have messaged the WhatsApp number once.

= What is the daily sales summary? =

One message per day, at the time you pick (default 21:00, your site timezone), with the day's paid order count (processing, completed and on-hold), total sales, and the number and total of refunds — sent to the same admin channels as the other alerts. It uses WP-Cron, so it runs whenever your site gets traffic or a real cron.

= How do customer alerts work? =

Turn on Customer alerts and choose the events — the same rules as the admin alerts: order confirmed, pending payment (which always includes the customer's pay link), order on hold, order completed, order cancelled, refund processed and failed payment (which always includes the customer's pay link). Customers are reached by email (their billing email, sent through your SMTP settings when enabled) and/or WhatsApp (their billing phone, through the same Meta app as the admin alerts). If a billing phone has no country code, the Default country code setting is added automatically. Telegram is admin-only and never messages customers.

= How do abandoned cart follow-ups work? =

When a signed-in customer changes their cart, or a guest types their email at checkout, the plugin saves the cart (email, phone if known, items, total). After the delay you set (default 2 hours), an hourly check sends at most one message per cart per run: first a price-drop alert if an item got cheaper, otherwise a low-stock alert if an item is nearly out of stock, otherwise a one-time reminder. Each alert type is sent at most once per cart, follow-ups stop as soon as the customer places an order, and messages use the customer email/WhatsApp channels from the Customer Alerts tab. You can see every tracked cart under Order Alerts → Pending Carts.

= Can I message customers on WhatsApp at any time? =

WhatsApp only allows free-form text inside the 24-hour customer service window (after the customer last messaged your number). Outside that window, Meta requires an approved template message for business-initiated conversations. Plain text works inside the window and for testing.

= What counts as a high-value order? =

Any order whose total reaches the threshold you set, when it becomes processing, on-hold or completed. The alert is sent once per order, marked as a high-value order, and can also go to an extra Telegram chat and an extra WhatsApp number that receive nothing else.

= Which SMTP settings should I use? =

Use the outgoing mail settings of your mail provider. Common choices: TLS with port 587, or SSL with port 465. For Gmail, use smtp.gmail.com, port 587, TLS, your Gmail address as the username and an App Password as the password.

= Will a failed notification break my checkout? =

No. Every send is checked and wrapped so failures are only logged (when WP_DEBUG is on). Checkout and order processing always continue normally.

= Does it work with HPOS (High-Performance Order Storage)? =

Yes. BundleWP Order Alerts declares compatibility with WooCommerce custom order tables (HPOS).

== Changelog ==

= 1.4.1 =
* Readme update.

= 1.4.0 =
* New licensing model: this one plugin again contains every feature. Email alerts stay completely free, and Telegram & WhatsApp alerts are part of the Pro version — buy the Pro version from bundlewp.com ($19 one-time) to unlock these platforms; after purchase you receive a license key to activate them, with no separate Pro download any more.
* New License tab in the Order Alerts settings: enter a key and activate it (verified online), see the masked key and status, and deactivate to free the key for another site. The locked Telegram and WhatsApp tabs carry the same key field and a buy button.
* The license key is re-verified automatically about once a day. A key that license verification definitively reports as invalid locks the channels again; if license verification cannot be reached, the channels keep their last known status.
* Telegram / WhatsApp credentials saved while the channels are locked are preserved untouched, and settings from 1.2.0 and earlier carry over as before.

= 1.3.0 =
* Telegram and WhatsApp alerts are now part of the Pro plan (BundleWP Order Alerts Pro, $19 one-time at bundlewp.com). The Telegram and WhatsApp tabs in Settings now show a Pro panel with a link to buy it, instead of the credential forms.
* This free version now sends alerts by email only — admin alerts, customer alerts and abandoned cart follow-ups by email all keep working in full, including SMTP settings, the daily sales summary, review alerts, stock alerts and high-value order alerts.
* Settings saved by older versions for Telegram and WhatsApp are simply ignored by this version (nothing is sent on those channels, and no errors are shown). If you buy Pro, install the Pro plugin and your settings carry over.
* Fixed the readme short description being longer than the 150 characters wordpress.org allows.

= 1.2.0 =
* Renamed from OrderPing to BundleWP Order Alerts for WooCommerce (new plugin file and text domain; all settings, order meta and cron hooks are unchanged, so existing setups keep working).
* External services are now fully documented in the readme: the Telegram Bot API and the Meta WhatsApp Cloud API, what data is sent and when, with links to their terms and privacy policies.
* Customer alerts now follow the same full event rules as the admin alerts: pending payment (always with the customer's pay link), on-hold and cancelled events join order confirmed, completed, refund processed and failed payment.
* New abandoned cart follow-ups: carts are remembered and customers get a reminder after a configurable delay, a price-drop alert when a cart item gets cheaper, and a low-stock alert when a cart item is almost out of stock — by email and/or WhatsApp, each at most once per cart, stopping as soon as the customer orders.
* Settings moved to a separate top-level "Order Alerts" admin menu with feature tabs (Email & SMTP, Telegram, WhatsApp, Admin Alerts, Customer Alerts, Cart Follow-ups, Templates) and a new read-only Pending Carts page.
* Removed the load_plugin_textdomain() call (no longer needed for WordPress.org-hosted plugins).

= 1.1.0 =
* New admin alerts: pending payment orders (with pay link) and on-hold orders as their own events.
* High-value order alerts with a configurable threshold, plus optional extra Telegram chat and WhatsApp number that receive only these alerts.
* Daily sales summary via WP-Cron at a configurable time: order count, total sales and refunds for the day.
* New product review alerts (product, star rating, reviewer, excerpt).
* Low-stock and out-of-stock alerts, duplicate-guarded to one per product every 12 hours.
* Customer alerts: order confirmed, order completed, refund processed and failed payment (with pay link) sent to the customer by email and WhatsApp, with their own message template and a default country code setting for phone numbers.
* Uninstall now also clears the daily summary cron event and the stock-alert transients.

= 1.0.0 =
* First release.
* Email order alerts with built-in free SMTP settings and a test email button.
* Telegram order alerts via the free Bot API, with a test message button.
* WhatsApp order alerts via your own Meta WhatsApp Cloud API account, with a test message button.
* Events: new, failed (with pay link), cancelled, completed and refunded orders.
* One shared message template with order placeholders.
* Duplicate-alert protection per order and event.
* HPOS compatible.
