#Overview
This action is triggered after WP Fusion has loaded the CRM integration module for the active CRM, but before WP Fusion has fully loaded.
It passes the active CRM by reference and allows you to modify properties of the active CRM.
Note: This action will not fire if WP Fusion is not connected to a CRM.
#Examples
#Whitelabel the CRM
This example renames the active CRM to a custom label.
function wpf_whitelabel_crm( &$crm ) {
$crm->name = 'Custom Name';
}
add_action( 'wp_fusion_init_crm', 'wpf_whitelabel_crm' );
#Change the View in CRM links
This example changes the View in CRM links across the WP Fusion UI. The %s
will be replaced by the contact ID of the relevant contact.
function wpf_rewrite_view_in_crm_links( &$crm ) {
$crm->edit_url = 'https://app.mybrand.com/v2/location/' . $crm->location_id . '/contacts/detail/%s';
}
add_action( 'wp_fusion_init_crm', 'wpf_rewrite_view_in_crm_links' );
#Use a custom OAuth app
For swapping out WP Fusion’s built in OAuth client IDs in order to connect to your own OAuth app, see this tutorial.
function set_custom_zoho_app( &$crm ) {
$crm->client_id = '1000.XXXXXXXXXXXXXXXXXXXXX';
$crm->client_secret_us = '08dccXXXXXXXXXXXXXXXXXXXXX';
}
add_action( 'wp_fusion_init_crm', 'set_custom_zoho_app' );
Was this helpful?
Let us know if you liked the post. That’s the only way we can improve.