1. Features
- WhatsApp Setting page under System Settings: WaAPI credentials, instance status check and a test message.
- Send WhatsApp page under Communicate with Group, Individual, Class and Today's Birthday tabs, the same workflow as Send SMS. Reuses your SMS Templates.
- Send now or schedule for a later date and time.
- WhatsApp Log with per-recipient delivery status and the exact WaAPI response, plus a Schedule WhatsApp Log.
- Route SMS Through WhatsApp: one switch delivers every automatic Smart School SMS notification on WhatsApp.
- Automatic phone number formatting (country code, spaces, dashes, leading zeros).
- Clean uninstall from the Addons page.
2. Requirements
| Item | Requirement |
|---|---|
| Smart School | 7.1.0 or later (System Settings > Addons must exist) |
| PHP | 7.4+ with the cURL extension (standard on almost all hosting) |
| WaAPI | An account at waapi.app with one instance linked to your WhatsApp number |
| Access | Super 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
- Log in to Smart School as Super Admin and go to System Settings > Addons.
- Drag
whatsapp_messaging.zipinto the upload box (or click it and choose the file) and submit. - The card Smart School WhatsApp Messaging (WaAPI) now shows an Install button instead of Buy Now.
whatsapp_messaging.zip.Step 3 – Install
- Click Install and wait for "The addon installation was successfully completed".
- Reload the page. You now have Communicate > Send WhatsApp, Communicate > WhatsApp Log and System Settings > WhatsApp Setting.
4. Get your WaAPI credentials
- Create an account at waapi.app and choose a plan.
- Create an Instance and note its Instance ID (the number on the instance card).
- 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.
- Copy your API Token from the WaAPI dashboard.
5. Configure the addon
Go to System Settings > WhatsApp Setting.
| Field | What to enter |
|---|---|
| Status | Enabled. Nothing is sent while Disabled; the page shows a yellow warning. |
| WaAPI Instance ID | The instance number from waapi.app, e.g. 101711 |
| WaAPI API Token | Your WaAPI API token |
| Default Country Code | Digits only, no plus sign, e.g. 92 (Pakistan) or 91 (India). Added to stored numbers that have no country code. |
| Show Link Preview | Whether links in messages show a preview card |
| Route SMS Through WhatsApp | Tick 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
| Tab | Recipients |
|---|---|
| Group | All students, all guardians, or every staff member of the selected roles |
| Individual | Search students, guardians or staff by name and add them one by one |
| Class | A class, one or more sections, students and/or guardians |
| Today's Birthday | Students 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:
- System Settings > SMS Setting > Custom SMS Gateway tab: enter any name and set Status to Enabled.
- System Settings > WhatsApp Setting: tick Route SMS Through WhatsApp, Status Enabled, Save.
- 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.
8. Scheduled messages (cron)
- System Settings > General Setting: make sure a Cron Secret Key is set.
- Copy the URL shown at the bottom of WhatsApp Setting.
- 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 School | Sent to WhatsApp as |
|---|---|
923001234567 | 923001234567 |
+92 300 1234567 | 923001234567 |
0092-300-1234567 | 923001234567 |
03001234567 | 923001234567 |
3001234567 | 923001234567 |
empty or 0 | not 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/.
| Permission | Controls |
|---|---|
| Send WhatsApp | Communicate > Send WhatsApp |
| WhatsApp Log | Communicate > WhatsApp Log (view, delete) |
| WhatsApp Setting | System 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
| Problem | Cause 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 install | Reload the page; then check Roles & Permissions for your role. |
Instance Status is not ready | The WhatsApp number is not linked. Scan the QR code on waapi.app. |
| Instance Status shows HTTP 401 / 403 | Wrong API token, or the instance does not belong to this token. |
| Log says Sent but nothing received | Check 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 fee | Route 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 save | Smart 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 out | The cron URL is not set up, or the Cron Secret Key is empty. |
| Emoji missing in the log | Delivered 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.