=== TechPad – WhatsApp for Tutor LMS ===
Contributors: thetechpad
Tags: tutor lms whatsapp, course enrollment whatsapp notifications, lms whatsapp alerts, whatsapp student notifications, whatsapp business api
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.1.3
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Send Tutor LMS course enrollment notifications straight to your WhatsApp — never miss a student.

== Description ==

Send Tutor LMS course enrollment notifications straight to your WhatsApp — never miss a student.

Email gets buried. When a new enrollment happens on your WordPress site, the details land in your WhatsApp instantly — so you can act on it right away instead of finding out hours later.

This plugin connects Tutor LMS to **The Tech Pad**, a WhatsApp Business API platform. It uses the official Meta WhatsApp Business API — no unofficial libraries, no click-to-chat links. Messages are sent as approved WhatsApp templates and replies come back into your Tech Pad inbox.

= Features =

* **Instant alerts** — every new enrollment sends a WhatsApp message to you (or any number you choose).
* **Per-course control** — enable notifications per course, override the recipient and template for each one.
* **Field mapping** — map the data to template variables in {1}, {2}… order, or send every field automatically.
* **Test send** — verify delivery from the settings page before going live.
* **Delivery log** — every send is recorded with status, Meta message id and errors; failed sends retry automatically and can be re-sent manually.
* **Runs in the background** — notifications are queued and sent via WordPress cron, so nothing on your site slows down.

= How it works =

1. Install and activate this plugin (it needs Tutor LMS active).
2. Open **The Tech Pad → Tutor LMS**.
3. Paste your API key and phone number ID from The Tech Pad dashboard (Developer settings) and pick an approved WhatsApp template.
4. Enable the courses you want notified and save.

The WhatsApp number the messages send from is your Tech Pad number, so all replies and conversations are managed in your Tech Pad inbox — campaigns, team inbox, automations and more.

Get a free workspace at **thetechpad.com**.

== Installation ==

1. Upload the `techpad-tutor-lms` folder to `/wp-content/plugins/`, or install the plugin through WordPress's “Add Plugins” screen.
2. Activate the plugin. Tutor LMS must be installed and active.
3. Go to **The Tech Pad → Tutor LMS**, paste your API key + phone number ID, pick your template and save.
4. Send a test message, then enable the courses you want notified.

== Frequently Asked Questions ==

= Do I need a The Tech Pad account? =

Yes. The plugin sends through The Tech Pad's WhatsApp Business API platform. Create a free workspace at https://thetechpad.com — your first 1,000 conversations a month are free on WhatsApp's standard pricing.

= Do I need an approved template? =

Yes — WhatsApp template messages are required for the first contact with a number. Create your template in The Tech Pad Template hub and wait for Meta approval (usually a few hours). The plugin sends every notification as a template message.

= What happens if the send fails? =

The delivery log shows the error. Failed sends retry automatically up to 3 times, and a Retry button is available on the settings page.

= Can I notify my customer instead of myself? =

Yes, with explicit opt-in. Set the recipient per course, or map a phone field captured with consent. Sending to a number without opt-in violates WhatsApp's policy.

= Does this slow down my site? =

No. Notifications are queued and sent in the background via WordPress cron — nothing on your site waits for WhatsApp.

== Changelog ==

= 1.1.3 =
* Fixed: an enabled form could send nothing while the log blamed the API key.
  The readiness check asked for the recipient and template to be set globally,
  even though both can be set per form — so a form with its own recipient and
  template was skipped with "Connection not configured". Readiness now needs
  the two credentials only (send key + sending number), and every skip message
  names exactly what is missing.
* New: the Connection card shows a checklist of anything a send still needs
  (send key, WhatsApp number, default recipient, default template) instead of a
  bare "Not connected yet".
* New: forms that are enabled but cannot send yet are flagged in red above the
  forms table, with the reason per form (no template chosen, no recipient, …).
* New: delivery-log skip reasons now list the missing setup items and point at
  the exact field to fill, so "form submitted, no WhatsApp message" is
  diagnosable without support.

= 1.1.2 =
* Fixed: an enabled form could send nothing while the log blamed the API key.
  The readiness check asked for the recipient and template to be set globally,
  even though both can be set per form — so a form with its own recipient and
  template was skipped with "Connection not configured". Readiness now needs
  the two credentials only (send key + sending number), and every skip message
  names exactly what is missing.
* New: the Connection card shows a checklist of anything a send still needs
  (send key, WhatsApp number, default recipient, default template) instead of a
  bare "Not connected yet".
* New: forms that are enabled but cannot send yet are flagged in red above the
  forms table, with the reason per form (no template chosen, no recipient, …).
* New: delivery-log skip reasons now list the missing setup items and point at
  the exact field to fill, so "form submitted, no WhatsApp message" is
  diagnosable without support.

= 1.1.1 =
* New: every Tech Pad plugin now lives in ONE **The Tech Pad** menu in wp-admin.
  Each platform gets its own labelled row (Contact Form 7, WPForms, Bookly…)
  instead of every plugin adding an identically named row under Settings, and
  the menu opens with a site overview: your connection plus a link to each
  Tech Pad plugin installed on this site.
* New: one shared delivery log for the whole family. Install several Tech Pad
  plugins and their sends are recorded in one table (each plugin still shows
  only its own provider's rows). Rows from the previous per-plugin table are
  carried over automatically on update.
* New: one shared template-list cache, so a site with several Tech Pad plugins
  asks the API once every five minutes instead of once per plugin.

= 1.1.0 =
* New: one-click email connect — the plugin creates your free Tech Pad
  workspace, send key and site connection from just your email (no dashboard
  visit, no key entry). Connect your WhatsApp number in the dashboard and the
  settings page auto-fills the number ID and templates.
* New: one connect serves the whole site — install another Tech Pad plugin and
  it is already connected (shared site connection).

= 1.0.0 =
* Initial release: per-course WhatsApp notifications, approved-template picker, field mapping, per-course recipient override, test send, and a delivery log with automatic retry.
