This guide explains how to configure syncing, tagging, group mapping, field mapping, and automation.
How Sync Works
- Client registration → Subscriber created in MailerLite
- Client update → Subscriber updated automatically
- WHMCS marketingoptin respected
- Unsubscribe webhook disables marketing in WHMCS
Client Group Mapping
Map WHMCS client groups to MailerLite Group IDs.
- Go to Client Group Mapping tab.
- Select a WHMCS Client Group.
- Assign the corresponding MailerLite Group ID.
- Save changes.
Clients in those groups will be subscribed to the mapped MailerLite group.
Product Tag Mapping
Assign MailerLite tags based on WHMCS product activation.
- Go to Product Tags tab.
- Select a WHMCS product.
- Assign one or more MailerLite tags.
- Save changes.
Tag Behaviour
- Tags are added when service becomes Active
- On cancellation, tags are NOT removed
- A cancellation log entry is recorded
Field Mapping
Map WHMCS custom client fields to MailerLite fields.
- Open Field Mapping tab.
- Select WHMCS custom field.
- Select corresponding MailerLite field.
- Save changes.
Only mapped fields will sync.
Bulk Import (Manual)
Import existing WHMCS clients into MailerLite.
- Go to Main tab.
- Click Bulk Import.
- Start the process.
Importing Large Datasets via Cron
If importing 20,000+ clients, use the cron importer:
php -q /path/to/whmcs/modules/addons/mailerlite_rest/cron_bulk_import.php
- Processes clients in batches
- Skips already subscribed records
- Prevents PHP timeout issues
Debug log location:
/modules/addons/mailerlite_rest/import_debug.log
Webhook Setup
- In MailerLite go to Integrations → Webhooks.
- Create new webhook.
- Use URL:
https://yourdomain.com/modules/addons/mailerlite_rest/webhook.php
The webhook must include subscriber email in the JSON payload.
Webhook Testing Tool
Use the Webhook Test tab to simulate an unsubscribe event.
This verifies that WHMCS marketing preference is correctly disabled.
Logging
The Logs tab records:
- API requests & responses
- Webhook activity
- Product tag assignments
- Cancellation logs
Logs support filtering and pagination.