=== W3 SMS for WordPress ===
Contributors: w3soft
Tags: sms, notifications, woocommerce, contact form 7, bangladesh
Requires at least: 5.8
Tested up to: 6.6
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 from WordPress through the W3 SMS API — a helper function for your own code, plus optional WooCommerce order and Contact Form 7 notifications.

== Description ==

This plugin connects your WordPress site to your [W3 SMS](https://w3sms.com) account so you can send text messages without writing any HTTP-request code yourself.

**What it gives you:**

* A settings screen (**Settings → W3 SMS**) for your Client ID, Client Secret and default Sender ID — copy these from your W3 SMS account's Developer Options page.
* A "Send Test SMS" tool right there, so you can confirm your credentials work before relying on them.
* A single function, `w3sms_send_sms()`, for sending a message from your own theme or plugin code.
* Two optional integrations, each with its own on/off switch:
  * **WooCommerce** — text the customer when their order becomes Processing or Completed.
  * **Contact Form 7** — text a number you choose whenever any form on the site is submitted.

**Using it in your own code:**

    $result = w3sms_send_sms( '8801XXXXXXXXX', 'Hello from WordPress!' );

    if ( is_wp_error( $result ) ) {
        error_log( $result->get_error_message() );
    }

Pass a third argument to use a sender ID other than the default one:

    w3sms_send_sms( '8801XXXXXXXXX', 'Hello!', 'MYBRAND' );

To read the account balance:

    $balance = w3sms_check_balance(); // float, or WP_Error

== Installation ==

1. Upload the `w3sms-for-wordpress` folder to `/wp-content/plugins/`, or install the zip through **Plugins → Add New → Upload Plugin**.
2. Activate the plugin.
3. Go to **Settings → W3 SMS** and enter your Client ID and Client Secret (from your W3 SMS account's Developer Options page) and your default Sender ID.
4. Send a test message from the same screen to confirm it works.

== Other Notes ==

= Hooks for developers =

Full parameter details are on the plugin's own **Settings → W3 SMS → Documentation** tab, and in `DOCUMENTATION.md` in the plugin folder. Summary:

* `w3sms_send_request_body` (filter) — change the request body before every send.
* `w3sms_order_notification_message` (filter) — rewrite the WooCommerce order SMS text.
* `w3sms_after_order_notification` (action) — fires after every order-status send attempt.
* `w3sms_cf7_notification_recipient` (filter) — choose who gets texted about a Contact Form 7 submission; return an empty string to skip it.
* `w3sms_cf7_notification_message` (filter) — rewrite the Contact Form 7 notification SMS text.
* `w3sms_after_cf7_notification` (action) — fires after every Contact Form 7 notification attempt.

== Frequently Asked Questions ==

= Where do I get my Client ID and Client Secret? =

Log in to your W3 SMS account and open **Developer Options** — both are shown there, along with the sender IDs approved on your account.

= Does this work without WooCommerce or Contact Form 7 installed? =

Yes. Those two are optional integrations, switched off by default. The core `w3sms_send_sms()` function works on any WordPress site regardless of which other plugins are active.

= What happens if a notification fails to send? =

It's written to the PHP error log and otherwise ignored — a failed SMS notification never blocks a checkout or a form submission.

== Changelog ==

= 1.0.0 =
* Initial release: settings screen, test-send tool, `w3sms_send_sms()` / `w3sms_check_balance()`, WooCommerce and Contact Form 7 integrations.
