Integration CF7 to Perfectum CRM
WordPress plugin that synchronizes Contact Form 7 submissions with the Perfectum CRM REST API.
Install
This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.
Install straight from GitHub with WP-CLI:
wp plugin install https://github.com/eugenemazuryk/integration-cf7-to-perfectum-crm/archive/refs/heads/main.zipWordPress plugin that synchronizes Contact Form 7 submissions with the Perfectum CRM REST API.
Version: 4.1.3
Requires: WordPress 5.0+, PHP 7.4+, Contact Form 7
License: GPL-2.0-or-later
🇬🇧 English
Description
On every successful CF7 mail send (wpcf7_mail_sent), the plugin builds a JSON payload from the configured field map and posts it to the Perfectum CRM API (default endpoint: /leads).
Key features
| Feature | Description |
|---|---|
| Admin panel | Contact → Sync with Perfectum CRM — map forms without code |
| Field mapping | CF7 name attributes → CRM field keys |
| Custom fields | Values go to custom_fields[entity][id] (entity: leads or clients) |
| Static fields | Lead Source ID and Status ID per form (required by CRM) |
| display_name prefix | Prefix + automatic page_title from the form |
| Credentials | Admin settings or PERFECTUM_API_URL / PERFECTUM_API_KEY in wp-config.php |
| Legacy mappers | Filter wl_perfectum_cf7_form_mappers for code-based mapping |
| Logging | Request/response logging when WP_DEBUG is on |
| Translations | English UI + Ukrainian (languages/) |
Installation
- Upload the
integration-cf7-to-perfectum-crmfolder to/wp-content/plugins/ - Activate the plugin
- Make sure Contact Form 7 is active
- Open Contact → Sync with Perfectum CRM
- Set API URL and API Key (or use constants below)
- Click + Add form, choose a CF7 form, map fields, set Source/Status IDs, save
Configuration via wp-config.php (recommended for production)
define( 'PERFECTUM_API_URL', 'https://crm.yourdomain.com/api' );
define( 'PERFECTUM_API_KEY', 'your_actual_api_token_here' );
When defined, these constants override the corresponding admin fields (fields become disabled in the UI).
Admin field mapping
- Select a Contact Form 7 form
- Optional Label for your own reference
- display_name prefix — text prepended to the page title
- Lead Source (Source ID) and Lead Status (Status ID) — numeric IDs from Perfectum
- Custom field entity —
leadsorclients - Field mapping table:
- CF7 field — input
name(e.g.your-name) or specialpage_title - CRM field — API key (e.g.
name,phonenumber,email) - Custom? — if checked, value is sent under
custom_fields[...]
- CF7 field — input
Legacy code-based mappers (optional)
If a form is not configured or not enabled in the admin UI, you can still register a PHP mapper:
add_filter( 'wl_perfectum_cf7_form_mappers', function ( $mappers ) {
$mappers[15000] = 'my_theme_perfectum_mapper';
return $mappers;
} );
function my_theme_perfectum_mapper( array $posted_data ): array {
return array(
'endpoint' => '/leads',
'data' => array(
'name' => $posted_data['your-name'] ?? '',
'phonenumber' => $posted_data['your-phone'] ?? '',
'email' => $posted_data['your-email'] ?? '',
'source' => 19,
'status' => 1,
),
);
}
Requirements
- WordPress 5.0+
- PHP 7.4+
- Contact Form 7
- Perfectum CRM account with API access
Changelog
See readme.txt for the full changelog.
🇺🇦 Українська
Опис
Плагін перехоплює успішне надсилання форм Contact Form 7 (хук wpcf7_mail_sent) і відправляє JSON-дані в REST API Perfectum CRM (за замовчуванням /leads).
Ключові можливості
| Можливість | Опис |
|---|---|
| Адмін-панель | Contact → Sync with Perfectum CRM — мапінг форм без коду |
| Мапінг полів | Атрибути name полів CF7 → ключі полів CRM |
| Кастомні поля | Значення в custom_fields[entity][id] (leads або clients) |
| Статичні поля | Source ID та Status ID ліда для кожної форми |
| Префікс display_name | Префікс + автоматична назва сторінки (page_title) |
| Облікові дані | У налаштуваннях або константи PERFECTUM_API_URL / PERFECTUM_API_KEY |
| Legacy-маппери | Фільтр wl_perfectum_cf7_form_mappers для PHP-маппінгу |
| Логування | Запити/відповіді в debug.log при увімкненому WP_DEBUG |
| Переклади | Англійський інтерфейс + український переклад |
Встановлення
- Завантажте папку
integration-cf7-to-perfectum-crmу/wp-content/plugins/ - Активуйте плагін
- Переконайтеся, що Contact Form 7 активний
- Відкрийте Contact → Sync with Perfectum CRM
- Вкажіть API URL і API Key (або константи нижче)
- Натисніть + Додати форму, оберіть форму CF7, налаштуйте мапінг і Source/Status ID, збережіть
Налаштування через wp-config.php (рекомендовано для продакшену)
define( 'PERFECTUM_API_URL', 'https://crm.yourdomain.com/api' );
define( 'PERFECTUM_API_KEY', 'your_actual_api_token_here' );
Константи мають пріоритет над полями в адмінці (поля стають неактивними).
Мапінг у адмінці
- Оберіть контактну форму CF7
- За бажанням вкажіть мітку для себе
- display_name prefix — текст перед назвою сторінки
- Source ID та Status ID — числові ID з Perfectum (обов’язкові)
- Custom field entity —
leadsабоclients - Таблиця мапінгу:
- CF7 поле —
nameінпута (наприкладyour-name) абоpage_title - CRM поле — ключ API (наприклад
name,phonenumber) - Custom? — якщо позначено, значення йде в
custom_fields[...]
- CF7 поле —
Legacy PHP-маппери (опційно)
Якщо форма не налаштована або вимкнена в адмінці, можна зареєструвати маппер у темі:
add_filter( 'wl_perfectum_cf7_form_mappers', function ( $mappers ) {
$mappers[15000] = 'my_theme_perfectum_mapper';
return $mappers;
} );
function my_theme_perfectum_mapper( array $posted_data ): array {
return array(
'endpoint' => '/leads',
'data' => array(
'name' => $posted_data['your-name'] ?? '',
'phonenumber' => $posted_data['your-phone'] ?? '',
'email' => $posted_data['your-email'] ?? '',
'source' => 19,
'status' => 1,
),
);
}
Вимоги
- WordPress 5.0+
- PHP 7.4+
- Плагін Contact Form 7
- Акаунт Perfectum CRM з доступом до API
Автор
Eugene Mazuryk — mazuryk-e.weblorem.com