=== CloudWave SMS ===
Contributors: cloudwavebd
Tags: sms, woocommerce, bulk sms, bangladesh, btrc
Requires at least: 5.8
Tested up to: 6.7
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Send SMS through your CloudWave Bulk SMS account: WooCommerce order updates, registration and password-reset notices, comment alerts, plus manual and bulk sends.

== Description ==

CloudWave SMS connects your WordPress or WooCommerce site to a CloudWave Bulk SMS
account (sms.cloudwavebd.com). It uses the portal's public REST API with a
per-integration API key and secret, so your portal login is never stored on the site.

**What it does**

* Balance widget and sender-ID/rate list read live from the portal.
* WooCommerce: an SMS on checkout, plus per-status messages (pending, processing,
  on hold, completed, cancelled, refunded, failed).
* WordPress: welcome SMS on registration, password-reset notification with the
  reset link, and new-comment alerts to the post author.
* Staff alerts: your own mobile numbers can receive new-order and new-user alerts.
* Manual sends to pasted numbers, a role, all users, or all WooCommerce customers.
* Bulk campaigns: large audiences are queued in the database and drained by
  WP-Cron every five minutes, so nothing times out and nothing is double-sent.
* Delivery log with status, cost in BDT, parts and error text, pruned automatically.
* Opt-out list — opted-out numbers are skipped everywhere, including automations.

**Requirements**

* WordPress 5.8+, PHP 7.4+
* A CloudWave Bulk SMS account with API credentials (API Access in the portal)
* WooCommerce is optional; without it the WooCommerce events simply stay hidden

== Installation ==

1. Upload the `cloudwave-sms` folder to `/wp-content/plugins/`, or install the ZIP
   through Plugins → Add New → Upload Plugin.
2. Activate the plugin.
3. Open **CloudWave SMS → Settings** and enter:
   * Portal base URL (default `https://sms.cloudwavebd.com`)
   * API key and API secret from the portal's *API Access* page
   * Optional: Default Sender ID, staff mobile numbers
4. Press **Test API connection** on the dashboard.
5. Open **Templates** and switch on the events you want.

== Frequently Asked Questions ==

= Where do customer phone numbers come from? =

The `cw_sms_phone` user meta first, then WooCommerce's `billing_phone`, then a
`phone` or `mobile` user meta. Only valid Bangladeshi mobile numbers are used.

= Does it send in Bangla? =

Yes. Any message containing Bangla is transmitted as Unicode automatically. The
character counter on the send screen tells you which encoding and how many parts
will be billed.

= Why are my bulk messages queued instead of sent immediately? =

The portal accepts up to 500 recipients per API call. Anything larger (or any
message containing merge tags, which must be personalised per recipient) is queued
and drained every five minutes by WP-Cron, keeping the request fast and cost visible.

= Do opt-outs apply to automated messages too? =

Yes. Every send path checks the opt-out list first.

== Changelog ==

= 1.0.0 =
* First release: WooCommerce order SMS, WordPress user events, staff alerts,
  manual and bulk sending, delivery log and opt-out management.
