What is WHMCS automation?
WHMCS automation allows your reseller hosting business to run with minimal manual work. Once configured, WHMCS automatically:
- Creates hosting accounts when invoices are paid
- Sends invoices to clients before renewals
- Reminds clients about unpaid invoices
- Suspends accounts when invoices become overdue
- Terminates cancelled or expired accounts
- Processes recurring payments automatically
- Sends welcome emails and account notifications
This guide covers the essential automation settings for a South African reseller hosting business using 0724 Hosting.
Prerequisites
Before configuring automation, ensure:
- WHMCS is installed and connected to DirectAdmin
- You have created hosting products with module settings configured
- Cron jobs are set up (required for automation to run)
- Email settings are configured correctly
Setting up the WHMCS cron job
WHMCS automation requires a cron job to run regularly (every 5-15 minutes). Without cron, automation will not work.
Configure cron in DirectAdmin
- Log in to your DirectAdmin reseller account
- Go to Advanced Features β Cron Jobs
- Click Create New Cron Job
- Configure the cron:
- Minute:
*/5(every 5 minutes) - Hour:
*(every hour) - Day:
*(every day) - Month:
*(every month) - Weekday:
*(every day of week) - Command:
php -q /home/yourusername/public_html/whmcs/crons/cron.php
- Minute:
- Replace
/home/yourusername/public_html/whmcs/with your actual WHMCS path - Click Create
The cron job will now run every 5 minutes, triggering WHMCS automation tasks.
Test cron is working
To verify the cron job is running:
- In WHMCS admin, go to Utilities β System β Automation Status
- Check Last Cron Run β it should show a recent time (within the last 5-15 minutes)
- If it shows "Never" or an old time, the cron job is not running correctly
Configuring automation settings
Go to Setup β Automation Settings to configure automation behaviour.
Invoice generation
- Invoice Days Before Due: How many days before renewal to generate invoices (recommended: 14 days)
- Generate Recurring Invoices: Enable this to automatically create invoices for recurring services
- Include Sub-Items: Include addons and upgrades in renewal invoices
- Automatic CC Processing: Enable to automatically attempt payment when invoices are generated
Payment reminders
- First Payment Reminder: Days after invoice due date to send first reminder (e.g., 3 days)
- Second Payment Reminder: Days after first reminder to send second reminder (e.g., 7 days)
- Third Payment Reminder: Days after second reminder to send third reminder (e.g., 14 days)
- Enable Overdue Notices: Enable this to send reminders automatically
Account provisioning
- Auto Provision on Payment: Automatically create hosting accounts when invoices are paid (recommended: enabled)
- Auto Provision on Order: Create accounts immediately on order, before payment (not recommended unless offering free trials)
- Provision Options: Choose which services to auto-provision
Account suspension
- Suspension Days: Days after due date before suspending accounts (recommended: 7-14 days)
- Auto Suspend: Enable to automatically suspend accounts with unpaid invoices
- Suspend Email Template: Select the email template to send when accounts are suspended
Account termination
- Termination Days: Days after suspension before terminating accounts (recommended: 30 days)
- Auto Terminate: Enable to automatically delete accounts that remain unpaid
- Termination Email Template: Email sent when accounts are terminated
Domain renewal
- Domain Renewal Notice Days: How many days before expiry to send domain renewal reminders
- Auto Renew: Automatically renew domains if clients have enabled auto-renew and valid payment method
Configuring product auto-setup
Each hosting product can have auto-provisioning enabled individually.
- Go to Setup β Products/Services β Products/Services
- Edit a hosting product
- Go to the Module Settings tab
- Check Automatically setup the product as soon as the first payment is received
- Optional: Enable Automatically setup the product as soon as an order is placed for instant setup (not recommended for paid services)
- Click Save Changes
Repeat for all hosting products.
Email automation
WHMCS sends automated emails for various events. Configure email templates to match your brand.
Essential email templates
- Hosting Account Welcome Email: Sent when hosting account is created (includes DirectAdmin login details)
- Invoice Created: Sent when an invoice is generated
- Invoice Payment Reminder: Sent for overdue invoices
- Service Suspension Notice: Sent when an account is suspended
- Service Termination Notice: Sent when an account is terminated
- Order Confirmation: Sent immediately after order is placed
- Invoice Payment Confirmation: Sent after successful payment
Customizing email templates
- Go to Setup β Email Templates
- Select a template to customise
- Edit the subject and body with your branding and details
- Use merge fields like
{$client_name},{$service_domain},{$invoice_id} - Save changes
See our WHMCS email templates guide for South African hosting templates.
Payment automation
Automatic credit card processing
If you accept recurring credit card payments (via payment gateways that support tokenization):
- Go to Setup β Automation Settings
- Enable Automatic Credit Card Processing
- Set how many days before due date to attempt automatic payment (e.g., 1 day)
- Save changes
WHMCS will automatically charge clients' saved payment methods for recurring invoices.
Supported payment gateways for South Africa
- PayFast (recommended for South African businesses)
- PayGate
- Stripe
- PayPal
- Bank transfer / EFT (manual payment verification)
Ticket automation
Automate support ticket routing and responses.
Auto-assign tickets to departments
- Go to Setup β Support β Support Departments
- Create departments (e.g., Billing, Technical Support, Sales)
- Configure email addresses for each department
- Enable Pipe to WHMCS for email-to-ticket conversion
Ticket auto-response
- Go to Setup β Email Templates
- Edit Support Ticket Opened template
- Customise the auto-response message
- Enable auto-response in department settings
SLA and escalation rules
For WHMCS with Service Level Agreement addon:
- Set ticket response time targets by priority
- Automatically escalate overdue tickets to senior staff
- Track SLA compliance for client reporting
Monitoring automation
Check automation status
- Go to Utilities β System β Automation Status
- Review:
- Last Cron Run: Should be within last 5-15 minutes
- Pending Tasks: Number of tasks waiting to run
- Recent Activities: Log of recent automation actions
View automation logs
- Module Log: Utilities β Logs β Module Log (shows provisioning/suspension/termination attempts)
- Activity Log: Utilities β Logs β Activity Log (shows all WHMCS admin and automated actions)
- Email Message Log: Utilities β Logs β Email Message Log (shows all sent emails)
Best practices for automation
- Test before enabling: Create test orders and invoices to verify automation works correctly
- Set appropriate grace periods: Give clients enough time to pay before suspending (7-14 days recommended for South Africa)
- Monitor automation logs: Regularly check for failed provisioning or suspension errors
- Backup before making changes: Always back up WHMCS before modifying automation settings
- Use merge fields in emails: Personalize automated emails with client and service-specific details
- Test email delivery: Ensure WHMCS emails are not going to spam
- Enable invoice reminders gradually: Start with one reminder, add more if needed
- Don't over-automate suspensions: Too-aggressive suspensions can alienate good clients
Troubleshooting automation issues
Cron not running
If automation is not working:
- Verify cron job is configured correctly in DirectAdmin
- Check cron command path matches your WHMCS installation location
- Ensure PHP CLI is available on your server
- Check DirectAdmin cron log for errors
- Contact support if cron continues to fail
Accounts not auto-provisioning
If accounts are not being created automatically:
- Ensure Auto Provision on Payment is enabled in Automation Settings
- Verify product has Automatically setup enabled in Module Settings
- Check the invoice is marked as "Paid"
- Review Module Log for provisioning errors
- Manually provision an account to see the specific error message
Emails not being sent
If automated emails are not sending:
- Verify email settings: Setup β General Settings β Email
- Test email delivery: Utilities β System β PHP Mail Test
- Check Email Message Log for failed sends
- Ensure SMTP settings are correct if using external SMTP
- Configure SPF/DKIM for your WHMCS domain to prevent spam filtering
Accounts suspending too early or too late
If suspension timing is incorrect:
- Check Suspension Days in Automation Settings
- Verify invoice due date is set correctly
- Ensure cron is running regularly (suspension only happens during cron runs)
- Review suspension logs in Module Log
Advanced automation
Custom automation with hooks
WHMCS supports custom automation via PHP hooks:
- Automatically assign specific IP addresses to new accounts
- Send custom notifications to admins
- Integrate with third-party systems
- Modify provisioning behaviour based on custom logic
Contact a WHMCS developer for custom automation requirements.
Workflow automation with action hooks
Use WHMCS Action Hooks to trigger custom actions:
- AfterModuleCreate: Run custom code after account provisioning
- AfterModuleSuspend: Trigger actions when accounts are suspended
- InvoicePaid: Execute code when invoices are paid
- ClientAdd: Run actions when new clients register
Getting help with WHMCS automation
If you need assistance configuring WHMCS automation, troubleshooting cron issues, or setting up custom automation workflows, contact 0724 Hosting support. We can help with:
- Setting up and troubleshooting cron jobs
- Configuring automation settings for South African businesses
- Creating custom email templates
- Resolving provisioning and suspension errors
- Setting up payment gateway integrations