=== CatCode GoSMS Notifications for WooCommerce ===
Contributors: catcodestudio
Tags: sms, gosms, woocommerce, order notifications, czech republic
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 GoSMS (gosms.eu): 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 [GoSMS](https://gosms.eu/) 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, billing first and last name, status name and the link to the order page.
* **Phone numbers sorted out** — numbers are turned into the international form (+420…) using the billing country, so "777 123 456", "0777123456" and "+420 777 123 456" 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 that could not reach GoSMS is retried once after five minutes; one that GoSMS refused (bad number, no credit) is not repeated, and the reason is written to the order notes.
* **Everything is in the order notes** — what was sent, to which number, or why it was not.
* **Check the price first** — one button asks GoSMS how many SMS a text takes and what it costs, without sending anything. A test message to your own phone is one click away.
* **Diacritics option** — replace accented letters with plain ones.
* **Optional consent** — add a checkbox "Send me SMS messages about my order" to the checkout (classic and block) and text only those who tick it.
* HPOS and block checkout compatible. The client secret is stored encrypted.
// @pro-begin
* Translations included: Czech.
// @pro-end

// @pro-begin
= Pro =

The Pro version is sold on [catcode.com.ua](https://catcode.com.ua/modules/catcode-gosms-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.
* **Delivery reports** — GoSMS calls an address on your site when a message is delivered or not; the journal and the order notes show it.
* **SMS journal** — every message with the order, number, text and state.
* **New order alert** — an SMS to your own phone when an order comes in.
* **Low credit warning** — an e-mail to the site admin when the prepaid credit falls 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

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

== External services ==

The plugin connects to the GoSMS API (ZooControl s.r.o., [gosms.eu](https://gosms.eu/), API documentation at [doc.gosms.eu](https://doc.gosms.eu/)) at `app.gosms.eu`, and only after you enter your credentials and tick a status.

* When you press "Check connection", and before every message: the client ID and the client secret, to get an access token.
* When a message is sent (and when you press "Check the price"): the text of the message, the phone number of the recipient and the ID of your channel. The text and the number come from the order, so they can contain the buyer's name and the order link.
* "Check connection" also reads your credit and your channels.

[Personal data protection at GoSMS](https://gosms.eu/en/personal-data-protection/)

== Installation ==

1. Upload the plugin and activate it. WooCommerce must be active.
2. WooCommerce → **GoSMS**. In GoSMS open selfservice → API, copy the client ID and the client secret into the plugin.
3. Press "Check connection", choose the channel, 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 a GoSMS account? =

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

= 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.

= Does the buyer have to agree? =

Order status messages are service messages, so the checkbox is off by default. Turn it on in the settings if you prefer to text only those who agree.

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

In the notes of the order.

== Changelog ==

= 1.0.0 =
* First release.
