=== CatCode SMSAPI Notifications for WooCommerce ===
Contributors: catcodestudio
Tags: sms, smsapi, woocommerce, order notifications, poland
Requires at least: 6.2
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

SMS messages about WooCommerce orders through SMSAPI (smsapi.pl, smsapi.com): the buyer is texted when the order status changes.

== Description ==

Sends an SMS to the billing phone number of the buyer when the status of an order changes, through your own [SMSAPI](https://www.smsapi.pl/) account. You edit the text of each message, and the plugin does the rest in the background.

* **Order statuses** — an SMS for "Processing" and for "Completed", each with its own text and an on/off switch.
* **Placeholders** — shop name, order number, order total, tracking number, billing first and last name, status name, the link to the order page and the link to pay.
* **Tracking number** — name the order field where your shipping plugin keeps the number, and {tracking_number} is filled from it.
* **New order alert** — an SMS to your own phone when an order comes in.
* **Phone numbers sorted out** — numbers are turned into the international form using the billing country, so "500 600 700", "0048 500 600 700" and "+48 500 600 700" all work.
* **Sent once** — each status sends one message per order, even when the status changes twice in a row or two requests overlap. A message SMSAPI refused (bad number, no points) is not repeated, and the reason is written to the order notes.
* **Token and points check** — one button tells you whether SMSAPI accepts the token and how many points the account has.
* **Check the price first** — one button asks SMSAPI how many points a text would cost, without sending anything. A test message to your own phone is one click away.
* **Polish letters option** — replace ą, ę, ł and the like with plain letters, so that a message fits into fewer SMS.
* **Journal** — the last messages with the order, number, text, points and state; every message is also in the notes of its order.
* Accounts opened on smsapi.pl and on smsapi.com are both supported.
* HPOS and block checkout compatible. The token is stored encrypted.
// @pro-begin
* Translations included: Polish.
// @pro-end

// @pro-begin
= Pro =

The Pro version is sold on [catcode.com.ua](https://catcode.com.ua/modules/catcode-smsapi-notifications-for-woocommerce/), with a 7-day trial that never starts by itself:

* **Every order status** — on hold, cancelled, refunded, failed and your own statuses, each with its own text.
* **Second set of texts** — buyers from other countries get their own text for every status, for example Polish for Poland and English for the rest.
* **Delivery reports** — SMSAPI reports every message back to your site; the journal and the order notes show "delivered" or "not delivered".
* **Your sender name** — choose one of the sender names that are active in your SMSAPI account.
* **Repeat** — when SMSAPI cannot be reached, the message is tried again after 5 and after 30 minutes.
* **Short links** — links in the messages go through the SMSAPI link shortener (idz.do / cut.li).
* **SMS checkbox at checkout** — classic and block checkout; only buyers who tick it are texted. The {opt_out_link} placeholder puts the SMSAPI opt-out link into promotional texts.
* **Abandoned cart reminders** — one SMS for an order that was placed but not paid, and for a cart left by a logged-in customer.
* **Campaigns** — one SMS to a segment of your buyers: those who agreed, by how recently they ordered and by country.
* **Low points warning** — an e-mail to the site admin when the points fall below the limit you set.
* **Message from the order screen** — a free-text SMS to the buyer of that order.
* Updates from catcode.com.ua.

The licence runs for 1-5 years and includes updates and support for that term; a purchased licence keeps its Pro features after the term ends. One key covers two sites: the shop and its test copy.
// @pro-end

SMSAPI is a trademark of its owner. This plugin is an independent integration made by CatCode; it is not an official plugin of SMSAPI and is not affiliated with or endorsed by it. You need your own SMSAPI account.

== External services ==

The plugin connects to the SMSAPI API (LINK Mobility Poland sp. z o. o., API documentation at [smsapi.pl/docs](https://www.smsapi.pl/docs) and [smsapi.com/docs](https://www.smsapi.com/docs)), and only after you enter your token. An account opened on smsapi.pl is reached at `api.smsapi.pl` (backup `api2.smsapi.pl`), one opened on smsapi.com at `api.smsapi.com` (backup `api2.smsapi.com`).

* Every request carries your OAuth token.
* When a message is sent (and when you press "Check the price"): the text of the message and the phone number of the recipient. The text and the number come from the order, so they can contain the buyer's name, the order number and the order link.
* "Check the token and the points" reads the user name and the points of your SMSAPI account.

smsapi.pl: [terms](https://www.smsapi.pl/regulamin), [privacy policy](https://www.smsapi.pl/polityka-prywatnosci). smsapi.com: [terms](https://www.smsapi.com/en/terms), [privacy policy](https://www.smsapi.com/en/privacy).

== Installation ==

1. Upload the plugin and activate it. WooCommerce must be active.
2. WooCommerce → **SMSAPI**. In the SMSAPI Customer Portal create an OAuth token and paste it into the plugin; choose whether the account was opened on smsapi.pl or smsapi.com.
3. Press "Check the token and the points", tick the order statuses and save.
4. Enter your own number, press "Send a test SMS", then place a test order.

== Frequently Asked Questions ==

= Do I need an SMSAPI account? =

Yes. The messages are sent and charged by SMSAPI through your account; the plugin does not sell SMS.

= Which sender name do the messages have? =

The default sender name of your SMSAPI account. You set it in the SMSAPI Customer Portal.

= Which phone numbers get a message? =

The billing phone of the order. With a missing or invalid number nothing is sent and an order note says so.

= Where does the tracking number come from? =

From the order field you name in the settings — the one your shipping plugin writes the number to. Developers can also hand it over through the `ccsmsapi_tracking_number` filter.

= A message was not sent. Where do I see why? =

In the notes of the order and in WooCommerce → SMSAPI journal.

== Changelog ==

= 1.0.0 =
* First release.
