Smart School WhatsApp Messaging (WaAPI) Addon

Send WhatsApp messages from Smart School and deliver automatic notifications (fee receipts, reminders, attendance, results) on WhatsApp.

Version 3.0 $50 USD
Smart School 7.1.x · Requires a waapi.app account · One-time payment, lifetime use

1. Features

2. Requirements

ItemRequirement
Smart School7.1.0 or later (System Settings > Addons must exist)
PHP7.4+ with the cURL extension (standard on almost all hosting)
WaAPIAn account at waapi.app with one instance linked to your WhatsApp number
AccessSuper Admin login and phpMyAdmin for one small SQL step

3. Installation

Step 1 – Register the addon (one time)

Smart School's Addons page only lists addons that exist in its addons table, so the zip must be registered once. Open phpMyAdmin, select the Smart School database, open the SQL tab, paste the contents of register/register_addon.sql (also shown below) and click Go. It is safe to run more than once.

INSERT INTO `addons` (`product_id`, `image`, `name`, `config_name`, `short_name`, `directory`,
  `description`, `price`, `current_version`, `article_link`, `installation_by`, `uninstall_version`,
  `unistall_by`, `addon_prod`, `addon_ver`, `last_update`, `current_stage`, `product_order`)
SELECT 90010001, 'addons/whatsapp_messaging/sswam_images.svg',
  'Smart School WhatsApp Messaging (WaAPI)', 'whatsapp-config', 'sswam', 'whatsapp_messaging',
  'WhatsApp Messaging addon adds WhatsApp sending capability in Smart School using the waapi.app WhatsApp API.',
  0.00, NULL, 'https://waapi.app', NULL, NULL, NULL, NULL, NULL, NOW(), 1, 11
FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM `addons` WHERE `product_id` = 90010001);

Step 2 – Upload the zip

  1. Log in to Smart School as Super Admin and go to System Settings > Addons.
  2. Drag whatsapp_messaging.zip into the upload box (or click it and choose the file) and submit.
  3. The card Smart School WhatsApp Messaging (WaAPI) now shows an Install button instead of Buy Now.
Do not rename the zip. The file name must stay whatsapp_messaging.zip.

Step 3 – Install

  1. Click Install and wait for "The addon installation was successfully completed".
  2. Reload the page. You now have Communicate > Send WhatsApp, Communicate > WhatsApp Log and System Settings > WhatsApp Setting.
The card may show a Register button. That is Smart School's licence prompt for addons sold by QDOCS; it is not used by this addon and can be ignored.

4. Get your WaAPI credentials

  1. Create an account at waapi.app and choose a plan.
  2. Create an Instance and note its Instance ID (the number on the instance card).
  3. Open the instance and scan the QR code from the WhatsApp app of the number you want to send from (WhatsApp > Linked devices > Link a device). The instance status becomes ready.
  4. Copy your API Token from the WaAPI dashboard.

5. Configure the addon

Go to System Settings > WhatsApp Setting.

FieldWhat to enter
StatusEnabled. Nothing is sent while Disabled; the page shows a yellow warning.
WaAPI Instance IDThe instance number from waapi.app, e.g. 101711
WaAPI API TokenYour WaAPI API token
Default Country CodeDigits only, no plus sign, e.g. 92 (Pakistan) or 91 (India). Added to stored numbers that have no country code.
Show Link PreviewWhether links in messages show a preview card
Route SMS Through WhatsAppTick to deliver Smart School's automatic SMS notifications on WhatsApp (section 7)

Click Save, then Check Instance Status (must say ready) and WhatsApp Test with your own number. "Smart School WhatsApp Test Successful." should arrive within seconds.

6. Send WhatsApp messages manually

TabRecipients
GroupAll students, all guardians, or every staff member of the selected roles
IndividualSearch students, guardians or staff by name and add them one by one
ClassA class, one or more sections, students and/or guardians
Today's BirthdayStudents and staff whose birthday is today

Pick an SMS Template or type the message, choose Send now or Schedule, and Submit. Messages are plain text; duplicate numbers inside one send are skipped.

7. Automatic notifications on WhatsApp

Smart School sends its automatic notifications through the active SMS gateway. The addon can take over that channel. Three settings are needed:

  1. System Settings > SMS Setting > Custom SMS Gateway tab: enter any name and set Status to Enabled.
  2. System Settings > WhatsApp Setting: tick Route SMS Through WhatsApp, Status Enabled, Save.
  3. System Settings > Notification Setting: tick SMS on every event you want on WhatsApp and choose recipients. Save.

From then on, collecting a fee in Fees Collection > Collect Fees sends the Fee Submission message to the guardian's WhatsApp automatically, and it appears in WhatsApp Log > Other Deliveries as sms_route. The same applies to fee reminders, admission and login credentials, attendance, exam results, homework, online examination, online admission, leave requests and every other event on the Notification Setting page.

If routing is on but the gateway is Disabled or incomplete, messages are not sent; they are recorded in the WhatsApp Log as failed with the reason, so nothing disappears silently.
Once Status is Enabled and routing is on, every event with SMS ticked reaches real students and guardians. Review Notification Setting first, then collect one fee for a known student and watch the WhatsApp Log.

8. Scheduled messages (cron)

  1. System Settings > General Setting: make sure a Cron Secret Key is set.
  2. Copy the URL shown at the bottom of WhatsApp Setting.
  3. Add it to your hosting's cron jobs, every 5 minutes:
*/5 * * * * wget -q -O /dev/null "https://your-school.com/whatsappcron/schedule/YOUR_KEY"

Pending and sent scheduled messages are listed under WhatsApp Log > Schedule WhatsApp Log.

9. WhatsApp Log

Communicate > WhatsApp Log shows every send with recipients, sent and failed counts; the action button opens per-recipient details (number, chat ID, status, WaAPI response, time). Other Deliveries lists test messages and routed notifications. Delete WhatsApp Log clears the log but keeps pending scheduled messages.

10. Phone number format

Numbers are converted automatically using the Default Country Code (example with 92):

Stored in Smart SchoolSent to WhatsApp as
923001234567923001234567
+92 300 1234567923001234567
0092-300-1234567923001234567
03001234567923001234567
3001234567923001234567
empty or 0not sent, logged as failed

11. Files and permissions

The installer copies the addon's files into application/ and creates three tables (whatsapp_config, whatsapp_messages, whatsapp_logs), one permission group and three sidebar entries. One existing file is replaced: application/libraries/Customsms.php, Smart School's empty custom SMS gateway placeholder. If you had edited it for your own SMS provider, keep a copy first; the installer also stores the original under addons/whatsapp_messaging/installer/install/backup/files/.

PermissionControls
Send WhatsAppCommunicate > Send WhatsApp
WhatsApp LogCommunicate > WhatsApp Log (view, delete)
WhatsApp SettingSystem Settings > WhatsApp Setting (view, edit)

Super Admin has everything; Admin is granted all three on install. Add them to other roles in Roles & Permissions as needed.

12. Troubleshooting

ProblemCause and fix
Upload says "file is invalid"The registration SQL (Step 1) was not run, or the zip was renamed.
Upload says "The addon has already installer files"An addons/whatsapp_messaging folder already exists. Skip the upload and click Install, or delete the folder and upload again.
Menus missing after installReload the page; then check Roles & Permissions for your role.
Instance Status is not readyThe WhatsApp number is not linked. Scan the QR code on waapi.app.
Instance Status shows HTTP 401 / 403Wrong API token, or the instance does not belong to this token.
Log says Sent but nothing receivedCheck the Chat ID column. Fix the Default Country Code if the number is wrong, and confirm the number has WhatsApp.
Nothing sent and nothing logged after collecting a feeRoute SMS Through WhatsApp is off, or the Custom SMS Gateway is not the enabled gateway, or SMS is not ticked for that event in Notification Setting.
Log shows "WhatsApp gateway is disabled or not configured"Status on WhatsApp Setting is Disabled, or Instance ID / token are empty.
Notification Setting page does not saveSmart School 7.1 expects three columns that older databases lack. Run once in phpMyAdmin:
ALTER TABLE notification_setting ADD COLUMN is_whatsapp varchar(10) DEFAULT '0', ADD COLUMN display_whatsapp int NOT NULL DEFAULT 0, ADD COLUMN whatsapp_template_id varchar(100) NOT NULL DEFAULT '';
Scheduled messages never go outThe cron URL is not set up, or the Cron Secret Key is empty.
Emoji missing in the logDelivered with emoji; only the stored copy drops them (3-byte UTF-8 database connection).

13. Uninstall

System Settings > Addons > Uninstall removes the addon's files, tables, permissions and menus. Customsms.php stays because Smart School requires the file; without the addon it behaves like the original placeholder. Smart School's uninstaller also writes an empty entry into application/config/license.php, which is harmless.