Connect WHMCS
Send WhatsApp messages to your hosting clients from WHMCS for invoices, overdue reminders, services, support tickets and domain renewals.
On this page
The WHMCS addon sends an approved WhatsApp template to a client when something happens in WHMCS: an invoice is created or paid, a payment is overdue, a service is activated or suspended, a ticket is answered, or a domain is about to expire. You choose which events send a message and which template each one uses.
The addon's name in WHMCS is Chatilo WhatsApp Notifications, whatever name your installation carries.
Before you start
- You need admin access to WHMCS (version 8) and a way to upload files to its server, such as FTP or a file manager.
- You need the addon folder
chatilo. Ask the person who runs your Chatilo installation for it. - You must be a workspace owner or admin to create an API key, and your plan must include API access (shown on plans as "API, Zapier and CRM sync").
- You need a connected WhatsApp number and at least one approved template. WhatsApp only lets a business message a customer first with a template that Meta has approved. See Create a template.
Step 1: Create an API key
- In Chatilo, in the sidebar under Automate, click API and webhooks.
- In the API keys card, click New key.
- In Key name, type
WHMCS. Under Access, keep Read and write selected. - Click Create key and copy the key from the green box straight away. It is not shown again.
Step 2: Upload and activate the addon
- Upload the
chatilofolder into themodules/addons/folder of your WHMCS installation. The result ismodules/addons/chatilo/chatilo.php. - In WHMCS, go to System Settings → Addon Modules.
- Find Chatilo WhatsApp Notifications and click Activate.
- Click Configure and fill in the settings listed below.
- Under Access Control, tick the admin roles that may open the addon, and click Save Changes.
| Setting | What to enter |
|---|---|
| Chatilo address | The address where you open Chatilo, starting with https://, with nothing after the domain. |
| API key | The key you copied. |
| Default country calling code | Digits only, for example 91. It is added to client phone numbers saved without a country code. |
| Client phone field | Client phone number uses the phone number on the client's profile. Choose Custom client field if you keep WhatsApp numbers in a custom field, and type that field's name in Custom phone field name. |
| Opt-out field name | The name of a custom client field that clients tick to stop WhatsApp messages. See "Let clients opt out" below. |
| Send-from number ID | Leave empty to send from your first WhatsApp number. The IDs are listed by the connection test in step 3. |
Step 3: Test the connection
- In WHMCS, go to Addons → Chatilo WhatsApp Notifications.
Click Test connection.
A green message shows your workspace name, followed by your WhatsApp numbers and your approved templates with the number of body values each one needs.
Step 4: Choose what to send
- In the Events table, tick Send for each event you want.
- In Template name, type the name of an approved template exactly as the connection test lists it.
- In Body values, write one line for each numbered variable in the template body, in order. See Template variables and samples.
- Click Save events.
| Event | When it is sent |
|---|---|
| New client (welcome) | A client signs up or is added. |
| Invoice created | An invoice is created and published to the client. |
| Invoice paid | An invoice is marked paid. |
| Invoice reminder before the due date | WHMCS sends its payment reminder. |
| First, second and third overdue notice | WHMCS sends each overdue notice. The days are set in WHMCS under Automation Settings. |
| Service activated | A product or service is set up. |
| Service suspended and Service unsuspended | A service is suspended or brought back. |
| Ticket opened by the client | A client opens a support ticket. |
| Staff replied to a ticket | A member of staff answers a ticket. |
| Domain renewal reminder and Domain expired notice | WHMCS sends its domain renewal emails. The days are set in WHMCS under Domain Reminder Settings. |
Values can be fixed text or fields. Every event can use {{first_name}}, {{last_name}}, {{full_name}}, {{company_name}}, {{email}}, {{business_name}} and {{client_area_url}}. Each row of the table lists the extra fields for that event:
| Events | Extra fields |
|---|---|
| Invoices and reminders | {{invoice_number}}, {{invoice_total}}, {{invoice_date}}, {{invoice_due_date}}, {{invoice_url}} |
| Services | {{product_name}}, {{domain}}, {{service_id}}, and {{suspend_reason}} for a suspension |
| Tickets | {{ticket_id}}, {{ticket_subject}}, {{ticket_department}}, {{ticket_url}} |
| Domains | {{domain}}, {{domain_expiry_date}}, {{domain_next_due_date}}, {{days_until_expiry}} |
For example, for a template that reads "Hi {{1}}, invoice {{2}} for {{3}} is due on {{4}}.", write these four lines in Body values:
{{first_name}}
{{invoice_number}}
{{invoice_total}}
{{invoice_due_date}}
Language is only needed when the template exists in more than one language. Header value is the header's variable, or a public link to the image, video or document if the template has a media header.
Let clients opt out
- In WHMCS, go to System Settings → Custom Client Fields and add a field.
- Set Field Name to
No WhatsAppand Field Type to Tick Box. Tick Show on Order Form if clients should see it when they sign up. - Make sure Opt-out field name in the addon's settings is the same name.
A client who ticks the box gets no WhatsApp messages from WHMCS. A client who replies STOP on WhatsApp is also not messaged again. See Opt-outs.
What happens next
- Every message appears under Last 100 messages on the addon page, with the result Sent, Failed or Skipped and the reason.
- A failed message is also written to the WHMCS Activity Log.
- New clients are added to your contacts in Chatilo, and the message appears in a conversation in the inbox.
- A problem with Chatilo never interrupts WHMCS. The invoice, ticket or service carries on and the failure is logged.
To pause one event, untick Send and save. Deactivating the addon in WHMCS stops all messages and deletes its event settings and its log.
Common problems
Test connection says "Send your API key as: Authorization: Bearer <key>."
The key is wrong or was deleted in Chatilo. Create a new key and paste it into the addon's settings. Also check that Chatilo address has nothing after the domain.
"Could not reach Chatilo"
Your WHMCS server cannot open the address. Check that it starts with https:// and that the server's firewall allows outgoing connections.
Skipped: "The client has no usable phone number."
The client's phone number is empty, or it has no country code and Default country calling code is empty. Fill in the default code, or correct the client's number.
Skipped: "The client has opted out of WhatsApp."
The client ticked your opt-out field. Untick it on the client's profile if that was a mistake.
Skipped: "No template is chosen for this event."
Send is ticked but Template name is empty. Type a template name and save.
Failed: "No approved template with that name and language on this number."
The template name is misspelt, the template is not approved yet, or it belongs to another WhatsApp number. Run Test connection to see the exact names, fill in Language if the template exists in several, and set Send-from number ID if you have more than one number.
Domain reminders are not sent
They follow WHMCS's own domain renewal emails. If the email templates "Upcoming Domain Renewal Notice" or "Expired Domain Notice" are disabled or renamed in WHMCS, no WhatsApp message is sent either.
The addon is not in the Addons menu
Your admin role has no access. Go to System Settings → Addon Modules, click Configure and tick your role under Access Control.
For WhatsApp's own errors see Messages not sending.
Client area: number verification and your pages
Version 1.1 of the addon adds a client area page at index.php?m=chatilo.
- Verify a WhatsApp number. Enter the name of an approved template that carries a one-time code under Verification template in the addon settings. Clients then see Send me a code on WhatsApp, type the code, and their number is marked verified. If they later change their number, they are asked to verify again.
- Show your pages. Tick Show pages to clients to list your published pages (forms, appointment booking, bill payments and others) for clients to open.
Link to the page from your client area menu or a welcome email. See API: pages, forms and one-time codes.