=== iBlueText Order Texts with iMessage and SMS for WooCommerce ===
Contributors: djxkon55
Tags: imessage, sms, woocommerce, order notifications, text message
Requires at least: 6.2
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.3
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Text customers order updates from your own business number: blue-bubble iMessage on iPhones, SMS on everything else. Alerts and a Text us button.

== Description ==

Texts from a real phone number get read. iBlueText sends your WooCommerce order updates from **your own dedicated US business number**, as a blue-bubble **iMessage** to iPhones and a regular **SMS** to Android and everyone else, picked automatically for each customer.

Customers can reply, and their replies land in your iBlueText inbox (web, iPhone and Android apps), so an order text turns into a real conversation.

**What it does**

* **Order texts:** Processing, Completed/shipped (with tracking), On hold, Cancelled, Refunded and Payment failed. Turn each on or off and write your own message with tags like {first_name}, {order_number}, {order_total} and {tracking_url}.
* **Checkout opt-in:** a "Text me order updates" box on the classic and block checkout. It always starts unticked, and only customers who tick it are texted (automatic and manual texts alike).
* **New-order alerts to you:** get a text the moment an order comes in, on as many phones as you like.
* **Text this customer:** a box on every order screen to send a one-off text.
* **"Text us" button:** a floating button or the `[ibluetext_button]` shortcode. Visitors tap it, their Messages app opens with a text to your number, and the chat lands in your inbox.
* **STOP handled for you:** anyone who replies STOP is never texted again.
* Sent in the background, so checkout is never slowed down. Works with High-Performance Order Storage.

**Pricing**

The plugin is free. Texts are sent through your iBlueText account: every new account gets free test texts with no card, then a line is $29/mo on your own Mac or $99/mo fully hosted. All prices are listed at [ibluetext.com/pricing](https://ibluetext.com/pricing.php), no demo or sales call.

iBlueText is an independent service by RG Loomis LLC. iMessage is a trademark of Apple Inc. WooCommerce is a trademark of Automattic Inc. This plugin is not affiliated with or endorsed by Apple or Automattic.

== External services ==

This plugin connects to the iBlueText API (https://ibluetext.com/api/v1/), run by RG Loomis LLC, to send text messages. It is required for the plugin to work.

* **When:** when an order changes to a status you turned on, when you send a test or a one-off text, when a new order alert is due, and (cached for 10 minutes) to look up your phone lines for the settings page and the Text us button.
* **What is sent:** your iBlueText API key, the recipient's phone number, the message text (which can include the customer's first and last name, order number, total and tracking link), and your site address in the User-Agent header. Nothing is sent until you enter an API key.
* **Customer first name:** on texts to a customer, the order's billing first name is also sent as a separate `first_name` field when it is present, even if your message template doesn't use it. iBlueText uses it only to fill a {firstname} tag in the message.
* **Order link:** the {order_url} tag is the customer's WooCommerce order-received page link, which includes the order key. If you use {order_url} in a message, that link (with the order key) is part of the text that is sent.
* Terms of service: https://ibluetext.com/terms.php
* Privacy policy: https://ibluetext.com/privacy.php

The "Text us" button is a plain sms: link; it doesn't contact any server.

== Installation ==

1. Install and activate the plugin.
2. Create a free account at https://ibluetext.com/portal/signup.php (no card needed).
3. In your iBlueText dashboard go to Integrations → API keys, create a key and copy it.
4. In WordPress open **iBlueText**, paste the key and save.
5. Send yourself a test text, then pick which order updates to send.

== Frequently Asked Questions ==

= Do my customers need an iPhone? =

No. iPhones get iMessage; everyone else gets a normal SMS. iBlueText decides per customer.

= Whose phone number do the texts come from? =

Your own dedicated iBlueText line, the same number every time, so customers can save it and text back. Before you add a line, trial texts come from our shared demo number.

= Can customers reply? =

Yes. Replies show up in your iBlueText inbox on the web and in the iBlueText iPhone and Android apps.

= What about opt-outs? =

Replying STOP opts a customer out of all your texts. With the checkout box option, only customers who tick it are texted.

= Does it work with the block checkout? =

Yes, WooCommerce 8.9 or newer adds the opt-in box to the block checkout. The classic checkout works on any supported version.

= Where does tracking come from? =

{tracking_number} and {tracking_url} read the standard WooCommerce Shipment Tracking data, which many shipping label plugins also write.

== Screenshots ==

1. Settings: connect, choose who gets texts and edit each order message.
2. "Text this customer" on the order screen.
3. The order text on an iPhone, as a blue iMessage.

== Changelog ==

= 1.0.3 =
* Manual "Text this customer" sends now check that you can edit that specific order (legacy and HPOS storage).
* The checkout opt-in box always starts unticked, and only customers who tick it are texted, automatically or manually. The "text every customer" option was removed.
* Texts go to the billing phone only (no fallback to the shipping phone).
* A queued text is skipped if you turned that notification off after it was queued.
* Stricter phone number checks: incomplete numbers are rejected and the significant leading zero (Italy, San Marino, Vatican) is kept.
* The External services section now also discloses the first_name field and the order key in {order_url}.

= 1.0.2 =
* Settings page: every field name is now escaped when output.

= 1.0.1 =
* Renamed to "iBlueText Order Texts with iMessage and SMS for WooCommerce".
* The order screen's "Text this customer" script now loads as an enqueued file.

= 1.0.0 =
* First release: order status texts, checkout opt-in (classic and block), new-order alerts, Text this customer, Text us button.
