🚀 WHMCS WhatsApp Notifications Module (Meta Cloud API, Evolution, Baileys) - Now 100% FREE and Open Source!
Free Addon for WHMCS WhatsApp Notifications Module for Meta, Evolution API and Baileys. Send Free WhatsApp Message Automatic by Hook, Manual or Custom.
- PHP: 8.2+;
- WHMCS: 8.6+
- Data Base SQL with permissions
- ALTER
- CREATE
- DELETE
- INDEX
- LOCK TABLES
- SELECT
- DROP
- INSERT
- REFERENCES
- UPDATE
- Download the latest
notifications.zipfrom the releases page. - Extract the zip → you will get a
lknhooknotification/folder. - Copy the
lknhooknotificationfolder into the WHMCSmodules/addons/directory. - In the WHMCS admin → Addon Modules → find the module → click Activate.
- Before starting, backup your WHMCS and database.
- Download the latest
notifications.zipfrom the releases page. - Replace the files: copy the contents of the
lknhooknotificationfolder overmodules/addons/lknhooknotification(overwrite), or delete the old folder and upload the new one. ⚠️ CRITICAL — do not skip: in the WHMCS admin → Addon Modules → find the module → save the module settings (Save button). This save triggers the upgrade (lknhooknotification_upgrade), applies the database migrations (DatabaseUpgrade::v200()→v461()) and registers the new version.- If step 4 is skipped, the version will not update; if the new version has a database upgrade, the module will fail with a database error (missing tables/columns).
- Access this link for more information on how to use and configure the notifications.
- Go to your WHMCS admin panel, navigate to Options > Addon Modules, find the WhatsApp and Chatwoot module and deactivate it.
- Access the root directory of your WHMCS, and go to the folder: /modules/addons.
- Inside the Addons folder, locate and delete the lknhooknotification folder.
- Delete the table created by the module in your WHMCS database; look for tables with names similar to the module, such as: mod_lkn_hook_notification*.
- SQL: BE CAREFULL. Run SQL commands:
DROP TABLE IF EXISTS `mod_lkn_hook_notification_bulks`;
DROP TABLE IF EXISTS `mod_lkn_hook_notification_localized_tpls`;
DROP TABLE IF EXISTS `mod_lkn_hook_notification_notif_queue`;
DROP TABLE IF EXISTS `mod_lkn_hook_notification_reports`;
DROP TABLE IF EXISTS `mod_lkn_hook_notification_configs`;
DROP TABLE IF EXISTS `mod_lkn_hook_notification_config`;For types documentation, follow https://phpstan.org/writing-php-code/phpdoc-types.
- Generate stubs
- Update the hardcoded current version
- Generate documentation
You need to run php stubs_generator.php to generate the code stubs, then copy the contents of stubs.php and paste them into the stubs.php file in the notifications repository.
Additionally, the dependency used to generate stubs does not support Enums, so it's necessary to manually copy the contents of the files under the /Config directory and paste them into stubs.php.
By running the command below, both internal and public documentation will be generated:
php phpDocumentor.phar --config=phpdoc.private.xml && php phpDocumentor.phar --config=phpdoc.public.xml
You need to push the /docs/public folder to the notifications repository on the main branch.
To view the internal documentation page, simply open the index.html file in /docs/public in your browser.
- WHMCS Addon Modules: https://developers.whmcs.com/addon-modules/
- WHMCS Hook Index: https://developers.whmcs.com/hooks/hook-index/
- Bootstrap 3.4: https://getbootstrap.com/docs/3.4/components/
- Bootstrap 3.4: https://getbootstrap.com/docs/3.4/css/
- Bootstrap 3.4: https://getbootstrap.com/docs/3.4/javascript/
- FontAwesome 5: https://fontawesome.com/v5/search
- Graph API WhatsApp
- Understanding the MessageTemplateParser class
- Understanding the Request to the WhatsApp API
- Send message template
- List message template
How to test the integration
- Create a free test account here. Look: https://www.chatwoot.com/docs/user-guide/setup-your-account/create-an-account/#i-am-using-the-cloud-version
- https://www.chatwoot.com/docs/product/channels/api/send-messages/
- About the Chatwoot APIs: https://www.chatwoot.com/docs/contributing-guide/chatwoot-apis
The one used by the module to send messages is the Application API.
- https://www.chatwoot.com/developers/api/#tag/Custom-Attributes/operation/add-new-custom-attribute-to-account
- https://www.chatwoot.com/hc/user-guide/articles/1677580558-website-live-chat-settings-explained
- https://www.chatwoot.com/hc/user-guide/articles/1677502327-how-to-create-and-use-custom-attributes
These are the notifications that are automatically executed along with a WHMCS hook.
Manual trigger notifications require an administrator action to be executed. They typically use a WHMCS hook ending in Output to display a button that, when clicked, triggers the notification.
In this case, the module simply provides a way to integrate notifications that use the same output hook. Currently, there are only two notifications of this type: the InvoiceReminder notifications, which use the AdminInvoicesControlsOutput hook.
They are placed here: /modules/addons/lknhooknotification/src/Notifications/Custom
They inherit the class. AbstractCronNotification.
To test, just set up locally or use ngrok:
docker run --net=host -it -e NGROK_AUTHTOKEN={NGROK_AUTHTOKEN} ngrok/ngrok:latest http 8080Copy the given URL and place it in the Evolution API configuration in the module.
To test, just set up locally or use ngrok:
docker run --net=host -it -e NGROK_AUTHTOKEN={NGROK_AUTHTOKEN} ngrok/ngrok:latest http 8080Copy the given URL and place it in the Baileys API in the module.
[
{
"messagename": "Password Reset Validation",
"relid": 1,
"mergefields": {
"user_first_name": "Jorge",
"user_last_name": "Mendes",
"user_email": "xxxxx@linknacional.com",
"reset_password_url": "https://www.WHMCSDOMAIN.com/index.php?rp=/password/reset/redeem/c96b9b7e2248870f4e8933009399232ce5d06a5e649cba2c6e6fd9c56f402c7f",
"company_name": "Link Nacional",
"companyname": "Link Nacional",
"company_domain": "https://www.WHMCSDOMAIN.com",
"company_logo_url": "",
"company_tax_code": null,
"whmcs_url": "https://www.WHMCSDOMAIN.com/",
"whmcs_link": "<a href=\"https://www.WHMCSDOMAIN.com/\">https://www.WHMCSDOMAIN.com/</a>",
"signature": "---<br />\r\nLink Nacional<br />\r\nhttp://www.WHMCSDOMAIN.com",
"date": "Tuesday, 20th May 2025",
"time": "10:22am",
"charset": "utf-8"
}
}
]