The WHMCS Client Export Script allows you to filter and export client data from your WHMCS database to a CSV file or directly to your Sendy mailing list.
Features
- Export client data as a CSV file.
- Directly export client data to a Sendy mailing list.
- Filter clients based on various criteria, such as language, client group, country, and more.
- Secure the script by restricting access to your local IP address.
Step-by-Step Guide
1. Set Up the Script
- Download the Script: Save the script files to any directory on your website. The directory must be on the same server as your WHMCS installation, but the path can be anything you choose. Ensure the files are stored in a location accessible to your WHMCS installation.
2. Configure the Script
- Navigate to Configuration:
Visit
configure.php
in your browser (e.g.,https://yourdomain.com/configure.php
). - Enter Required Settings:
- WHMCS Path: The path to your WHMCS installation directory.
- License Key: Your WHMCS license key.
- Restrict Access by IP:
Open the
config.php
file and locate thesafelist_ip
variable.$safelist_ip = '123.45.67.89'; // Replace with your IP
Only requests from the specified IP address will be allowed. Other users will see an "Access Denied" message.
To find your IP address, visit this page.
- Sendy Integration (Optional):
- Provide the Sendy URL, API key, and List ID if you want to export directly to a Sendy mailing list.
3. Use the Script
- Open the Export Page:
Navigate to the script's main page (e.g.,
https://yourdomain.com/export.php
). - Filter Clients:
Use the provided filters to refine your client selection:
- Language: Select a specific client language or choose "Any".
- Client Group: Filter clients by group or select "Any".
- Country: Narrow results to a specific country.
- Active Domains: Include only clients with active domains.
- Active Affiliates: Filter for clients who are active affiliates.
- Credit Balance: Include clients with a credit balance above 0.01.
- Email Opt-Out: Optionally include clients who opted out of email marketing.
- Client Status: Filter by status (Active, Inactive, or Closed).
- Date Added: Include only clients added after a specific date.
- Export Data:
- Export to CSV: Click the "Export CSV" button to download the data as a CSV file.
- Export to Sendy: If Sendy credentials are configured, click "Export to Sendy" to send the data to your Sendy mailing list.
Security Considerations
- Restrict Access: Always restrict access to your local IP by setting the
safelist_ip
variable inconfig.php
. - Keep Configuration Secure: Ensure that sensitive credentials like your Sendy API key and WHMCS database credentials are stored securely in
config.php
.
Common Issues
- "Access Denied" Error:
Check the
safelist_ip
value inconfig.php
and confirm it matches your current IP. - Database Connection Error:
Verify the WHMCS database credentials in your
configuration.php
file.Ensure your WHMCS installation path is correct.
- Sendy Export Issues:
Ensure the Sendy URL, API key, and List ID are correctly configured.
Verify that your Sendy installation is accessible from your server.