=== Orderchirp – Order Notifications on Telegram for WooCommerce ===
Contributors: bekserviceltd
Tags: woocommerce, telegram, order notifications, order status, notifications
Requires at least: 6.5
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 0.1.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Message your WooCommerce customers on Telegram when their order is received, shipped or completed, and get new-order alerts yourself.

== Description ==

Email order updates get lost in spam folders. Orderchirp sends them where people actually read: Telegram.

**For your customers**

* A "Get updates on Telegram" button on the order received page, in the order email and in My Account.
* One tap opens your shop's bot. From then on they get a message whenever their order changes status: received, completed (with the tracking number when a tracking plugin added one), cancelled, refunded – you choose which statuses and write the text.
* They can reply. The reply is added to the order as a note and forwarded to you.
* They send /stop at any time and the messages stop.

**For you**

* An alert on Telegram for every new order, with the items and the total.
* Low-stock and out-of-stock alerts.
* An Activity page that shows every message sent and received.

**Built properly**

* Uses your own Telegram bot (free from @BotFather) – messages come from your shop's name, not ours.
* Works with the block checkout and with WooCommerce's order storage (HPOS).
* Messages are sent in the background, so a slow network never slows down your checkout. If Telegram asks to slow down, Orderchirp waits exactly as long as asked.
* Works on sites without HTTPS too: Orderchirp then checks for messages once a minute instead of using a webhook.
* Personal data export and erasure through the WordPress privacy tools.

== External services ==

Orderchirp connects to the **Telegram Bot API** (https://api.telegram.org), run by Telegram FZ-LLC, to send and receive messages through the bot you connect. Nothing is sent before you connect a bot.

* When you connect a bot: the bot token you enter is sent to Telegram to check it (getMe) and to register this site's webhook address (setWebhook), or to remove it (deleteWebhook).
* When a customer has turned on Telegram updates: their Telegram chat ID and the text of each order message (which can include their first name, order number, items, total and tracking number) are sent to Telegram when the order changes status.
* When you have added your own chat: new-order details, stock alerts and customer replies are sent to your chat.
* On sites without HTTPS: once a minute the plugin asks Telegram for new messages to the bot (getUpdates).

Telegram's terms of service: https://telegram.org/tos and Bot API terms: https://telegram.org/tos/bot-developers – privacy policy: https://telegram.org/privacy

== Installation ==

1. Install and activate Orderchirp (WooCommerce must be active).
2. In Telegram, open @BotFather, send /newbot and follow the steps. Copy the token it gives you.
3. Go to WooCommerce → Orderchirp, paste the token and press Connect.
4. Press "Add a chat" and open the link on your phone to get your own alerts.
5. On the Messages tab, choose which order statuses send a message and edit the texts.

== Frequently Asked Questions ==

= Does the customer need to do anything? =

Yes, once: press "Get updates on Telegram" and then Start in Telegram. Telegram does not allow a bot to write to someone first, so nobody gets a message they did not ask for.

= Can I use WhatsApp? =

WhatsApp and SMS are in Orderchirp Pro. This plugin works with Telegram only and has no limits.

= Which tracking plugins are supported? =

Any plugin that stores tracking in the standard _wc_shipment_tracking_items order field, including WooCommerce Shipment Tracking and Advanced Shipment Tracking. The {tracking_number}, {tracking_provider} and {tracking_url} placeholders are filled from it; a line whose tracking placeholders are empty is left out.

= My site has no HTTPS. Will it work? =

Yes. Telegram only calls HTTPS addresses, so Orderchirp checks for new messages once a minute instead. Replies and /start links then take up to a minute.

= Where is my bot token stored? =

In your WordPress database, like other plugin settings. It is never sent anywhere but Telegram.

== Screenshots ==

1. Connecting your Telegram bot.
2. The message text for each order status.
3. The button customers see on the order received page.
4. Order updates as the customer sees them in Telegram.

== Changelog ==

= 0.1.0 =
* First release: customer order-status messages, new-order and stock alerts, customer replies as order notes, webhook or polling delivery, message log, privacy export and erasure.
