WP Fusion can be extended to connect to additional CRMs or other contact databases outside of our included integrations.
For a bootstrap to get you started, download this example plugin from GitHub.
While WP Fusion is pretty flexible, it does not work with all platforms.
For WP Fusion to work properly, your CRM or marketing automation tool must at minimum have API methods for:
- Get all available tags (or “segments”, “groups”, “static lists”, aka whatever is going to be used for segmenting contacts)
- Get all available contact custom fields (or “attributes”, “properties”, etc.)
- Search for a contact ID by email address
- Load the tags for a contact, by ID
- Apply tags to a contact, by contact ID
- Remove tags from a contact, by contact ID
- Add a new contact, and return a contact ID
- Update a contact by ID
- Load a contact and all their properties, by contact ID
- (optional) Search for contacts by tag name or ID. This is required for the Import Tool to work.
Setting up a custom CRM module
First download the starter plugin. Then do a find and replace (case sensitive) on two strings:
- “custom”: This is the slug for the integration. Change it to something like “my_crm_name”
- “Custom”: This is the title for the integration, and is also used for the class names. Change it to something like “My_CRM_Name”
Also change the file names to reflect the new slug.
Then you can go through each of the methods in class-wpf-custom.php and update them with the API calls specific to your integration, following the guide here.
There are three important files:
- wp-fusion-custom-crm.php: This is the base plugin file. It defines the plugin name, loads the dependencies, and adds the custom CRM to the dropdown in WP Fusion’s setup tab.
- class-wpf-custom.php: This is the base class for custom module. It includes all API calls and methods relating to sending and retrieving data.
- class-wpf-custom-admin.php: This file is only loaded in the WordPress admin. It defines the settings required to establish a connection, and contains any additional admin functionality.
$supports: This variable declares some CRM-specific features to other aspects of WP Fusion. If the CRM supports “add_tags”, then WP Fusion’s tag dropdowns will support typing in a new tag name on the fly. If the platform uses tag IDs, or requires tags to be registered before they’re used, don’t declare support for “add_tags”.
“add_fields” works similarly to “add_tags”. If the CRM supports “add_fields”, users will be able to enter custom fields on the fly. Don’t use this if the platform requires field IDs.