# FluentCRM Filter Hooks
FluentCRM Core IntermediateFluentCRM has many interesting filter hooks that let developers change default settings and even extend FluentCRM with new functionality.
# What are Filter Hooks
A hook is a feature that allows developers to manipulate functionality without modifying core files. A hook can help developers inject some functions or edit default settings.
Filter hooks are used to return modified values for certain parameters, based on different factors.
# Available Filter Hooks
# General Filters
# fluent_crm/disable_global_search
By Default FluentCRM provides you a search bar when for easily search contacts and access FluentCRM pages. If you want to remove this feature you can use this hook
Parameters
- $statusBoolean - Default false
Usage:
/*
* Disable FluentCRM search on admin bar
*/
add_filter('fluent_crm/disable_global_search', function($status) {
   return true;
});
2
3
4
5
6
# fluent_crm/will_auto_unsubscribe
By Default FluentCRM ask the reason to unsubscribe but if you want to disable that and automatically unsubscribe without showing the form then you can use this hook
Parameters
- $statusenum - 'yes' or 'no', Default 'no'
Usage:
/*
* Automatically unsubscribe in one click 
*/
add_filter('fluent_crm/will_auto_unsubscribe', function($status) {
   return 'yes';
});
2
3
4
5
6
# fluent_crm/will_use_cookie
By Default FluentCRM set cookie when someone click a link to track further actions like purchase and track revenue for that email campaign / sequence / automation.
Parameters
- $statusboolean- Usage: - Attention - If you use the code snippet, no revenue report will be recorded - /* * Disable Cookie */ add_filter('fluent_crm/will_use_cookie', function($status) { return false; });1
 2
 3
 4
 5
 6
# fluent_crm/is_simulated_mail
If you want to simulate all email sending from FluentCRM then you can use this hook.
Parameters
- $statusboolean
- $dataEmail Data
- $headersEmail Headers Usage:
Attention If you use the code snippet, no email will be sent from FluentCRM
   /*
   * Disable Email 
   */
   add_filter('fluent_crm/is_simulated_mail', function($status) {
      return true;
   });
2
3
4
5
6
# fluent_crm/countries
If you alter the country lists of FluentCRM then you may use this filter.
Parameters
- $countriesArray
Usage:
add_filter('fluent_crm/countries', function($countires) {
  // Process the conutries
  
  return $countries;
}, 20); // priority need to be greated than 10
2
3
4
5
# Frontend Filters
# fluent_crm/unsubscribe_texts
If you want to customize the labels on Unsubscribe page then you can use this filter hook.
Parameters
- $textsArray - Labels and texts of the unsubscribe page form
- $subscriberSubscriber Model - Current Subscriber who is unsubscribing now
$texts = [
  'heading'             => __('Unsubscribe', 'fluent-crm'),
  'heading_description' => __('We\'re sorry to see you go!', 'fluent-crm'),
  'email_label'         => __('Your Email Address', 'fluent-crm'),
  'reason_label'        => __('Please let us know a reason', 'fluent-crm'),
  'button_text'         => __('Unsubscribe', 'fluent-crm')
];
2
3
4
5
6
7
Usage:
/*
* Alter Button Text of Unsubscribe form
*/
add_filter('fluent_crm/unsubscribe_texts', function($texts, $subscriber) {
   $texts['button_text'] = 'Unsubscribe (No email updates)';
   return $texts;
}, 10, 2);
2
3
4
5
6
7
# fluent_crm/unsub_response_message
After a contact unsubscribe and if you want to change the response message programmatically you may use this hook.
Parameters
- $messageString - After Unsubscribe Response Message
- $subscriberSubscriber Model - Current Subscriber who is unsubscribing now
Usage:
/*
* Change Unsubscribe Response Text
*/
add_filter('fluent_crm/unsub_response_message', function($message, $subscriber) {
   return 'You are unsubscribed and no further email will be sent';
}, 10, 2);
2
3
4
5
6
# fluent_crm/unsub_redirect_url
After a contact unsubscribe and if you want to redirect the contact programmatically then you can use this hook
Parameters
- $redirectUrlString URL - After Unsubscribe Redirect URL
- $subscriberSubscriber Model - Current Subscriber who is unsubscribing now
Usage:
/*
* Change Unsubscribe Redirect URL
*/
add_filter('fluent_crm/unsub_redirect_url', function($redirectUrl, $subscriber) {
   return 'https://domain.com/path-to-my-custom-redirect';
}, 10, 2);
2
3
4
5
6
# fluent_crm/double_optin_options
After Double Optin Confirmation, if you want to change the default behavior (like redirect to a different URL or show different content) then you can use this filter hook
Parameters
- $configArray - Settings of the default response config including redirect URL
- $subscriberSubscriber Model - Current Subscriber who is unsubscribing now
$config = [
  'after_confirmation_type' => 'redirect', // or message
  'after_confirm_message'     => 'MESSAGE_DEFINED_IN_SETTINGS',
  'after_conf_redirect_url'   => 'URL DEFINED IN SETTINGS',
];
2
3
4
5
Usage:
/*
* Redirect to custom URL after DOI confirmation
*/
add_filter('fluent_crm/double_optin_options', function($config, $subscriber) {
   $config['after_confirmation_type'] = 'redirect';
   $config['after_conf_redirect_url'] = 'https://domain.com/path-to-confirm-page';
   return $config;
}, 10, 2);
2
3
4
5
6
7
8
# fluent_crm/pref_labels
Manage Subscription Page Labels Filter Hook
Parameters
- $labels- Manage Subscription Page Labels
$labels = [
    'first_name'      => __('First Name', 'fluent-crm'),
    'last_name'       => __('Last Name', 'fluent-crm'),
    'prefix'          => __('Title', 'fluent-crm'),
    'email'           => __('Email', 'fluent-crm'),
    'phone'           => __('Phone/Mobile', 'fluent-crm'),
    'dob'             => __('Date of Birth', 'fluent-crm'),
    'address_line_1'  => __('Address Line 1', 'fluent-crm'),
    'address_line_2'  => __('Address Line 2', 'fluent-crm'),
    'city'            => __('City', 'fluent-crm'),
    'state'           => __('State', 'fluent-crm'),
    'postal_code'     => __('ZIP Code', 'fluent-crm'),
    'country'         => __('Country', 'fluent-crm'),
    'update'          => __('Update info', 'fluent-crm'),
    'address_heading' => __('Address Information', 'fluent-crm'),
    'list_label'      => __('Mailing List Groups', 'fluent-crm'),
];
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
Usage:
/*
* Alter Labels of the form
*/
add_filter('fluent_crm/pref_labels', function($labels) {
    $labels['update'] = 'Update My Profile';
    return $labels;
});
2
3
4
5
6
7
# fluent_crm/pref_form_fields
Manage Subscription Shortcode Fields customization Hook
Parameters
- $formFields- Manage Subscription Form Fields Array
- $subscriber- Current Subscriber
Usage:
add_filter('fluent_crm/pref_form_fields', function($formFields, $subscriber) {
   // Customize the $formFields and return
   
   return $formFields;
}, 10, 2);
2
3
4
5
6
# fluent_crm/show_unsubscribe_on_pref
By Default FluentCRM does not show unsubscribe button on Manage Subscription Page
Parameters
- $status- Boolean
Usage:
// Show Unsubscribe Button on Manage Subscription Page
add_filter('fluent_crm/show_unsubscribe_on_pref', function($status) {
   return true;
});
2
3
4
# fluent_crm/double_optin_email_subject
You can customize the double optin email subject from settings page but if you want to alter that then you can use this hook.
Parameters
- $emailSubject- String
- $subscriber- Subscriber Model
Usage:
add_filter('fluent_crm/double_optin_email_subject', function($emailSubject, $subscriber) {
   // do you staff
   
   return $emailSubject;
}, 10, 2);
2
3
4
5
# fluent_crm/double_optin_email_body
You can customize the double optin email body from settings page but if you want to alter that then you can use this hook.
Parameters
- $emailBody- String
- $subscriber- Subscriber Model
Usage:
add_filter('fluent_crm/double_optin_email_body', function($emailBody, $subscriber) {
   // do you staff
   
   return $emailBody;
}, 10, 2);
2
3
4
5
# Admin Dashboard Filters
# fluent_crm/dashboard_stats
If you want to add or remove dashboard stats cards then you can use this filter.
Parameters
- $statsArray - Dashboard stats cards as containing each- stat
$stat = [
    'title' => 'Stat Title',
    'count' => 1234,
    'route' => [
        'name' => 'dashboard' // fluentcrm route to reditect once click. Leave blank if not route
    ]
];
2
3
4
5
6
7
Usage:
/*
* Add Own Stat
*/
add_filter('fluent_crm/dashboard_stats', function($stats) {
   $stats['my_stat_key'] = [
        'title' => 'Stat Title',
        'count' => 1234
   ];
   return $stats;
});
2
3
4
5
6
7
8
9
10
# fluent_crm/quick_links
if you want to customize quick links of FluentCRM Dashboard then use this hook.
Parameters
- $linksArray - Dashboard stats cards as containing each- $link
$link = [
    'title' => 'Link Title',
    'url'   => 'https://domain.com/path-to-link',
    'icon'  => 'el-icon-user' // optional
]; 
2
3
4
5
Usage:
/*
* Add Own Link
*/
add_filter('fluent_crm/quick_links', function($links) {
   $links[] = [
        'title' => 'Link Title',
        'url'   => 'https://domain.com/path-to-link',
        'icon'  => 'el-icon-user' // optional
   ];
   return $links;
});
2
3
4
5
6
7
8
9
10
11
# fluent_crm/dashboard_notices
If you want to show notices to FluentCRM admin panel then you may use this hook.
Parameters
- $noticesFlat Array
Usage:
/*
* Add Custom Notice
*/
add_filter('fluent_crm/dashboard_notices', function($notices) {
   $notices[] = '<p>My Custom Notice Here</p>';
   return $notices;
});
2
3
4
5
6
7
# fluent_crm/sales_stats
If you want to add custom sales stats on FluentCRM Dashboard widget then use this hook.
Parameters
- $statsArray
Usage:
/*
* Add Custom Sales Stat
*/
add_filter('fluent_crm/sales_stats', function($stats) {
  $stats[] = [
        'title' => 'Custom Stat Title',
        'content' => 'Stat Content'
  ];
  
  return $stats;
});
2
3
4
5
6
7
8
9
10
11
# Other Useful Filters
# fluent_crm/enable_unsub_header
By Default FluentCRM include unsubscribe header to marketing emails. If you don't want to include the unsubscribe-list header, you can use this hook.
Parameters
- $statusBoolean - Default false
Usage:
/*
* Disable FluentCRM Unsubscribe-List header
*/
add_filter('fluent_crm/enable_unsub_header', function($status) {
   return false;
});
2
3
4
5
6
# fluent_crm/email_headers
If you want to add custom email (mime) header you can use this hook
Parameters
- $headersarray
- $dataarray - Email Data
Usage:
/*
* Add Custom Header to FluentCRM Email Mime
*/
add_filter('fluent_crm/email_headers', function($headers, $data) {
   // Add or remove headers
   
   return $headers;
}, 10, 2);
2
3
4
5
6
7
8
# fluent_crm/enable_mailer_to_name
By Default FluentCRM include name of the contact when sending emails for better deliverability, if you want to disable that, you can use this hook
Parameters
- $statusBoolean - Default false
Usage:
/*
* Disable FluentCRM Name to Email
*/
add_filter('fluent_crm/enable_mailer_to_name', function($status) {
   return false;
});
2
3
4
5
6
# fluent_crm/user_permissions
You can customize the user's permission set from FluentCRM settings page. But if you want to customize that from code level you can use this hook.
Parameters
- $permissionsFlat Array - Permission Array
- $wpUser\WP_User - WordPress User
Usage:
/*
* Customize Permissions
*/
add_filter('fluent_crm/user_permissions', function($permissions, $wpUser) {
   // Customize the permission for specific user and then return
   return $permissions;
}, 10, 2);
2
3
4
5
6
7
# fluent_crm/default_email_design_template
If you want to change the default email design template, you may use this hook.
Parameters
- $designTemplateSlugstring - Default 'simple'
Usage:
/*
* Change Email Template Type to classic
*/
add_filter('fluent_crm/default_email_design_template', function($designTemplateSlug) {
   return 'classic';
});
2
3
4
5
6
# fluent_crm/contact_name_prefixes
By Default FluentCRM name prefixes are Mr, Mrs and Ms, You want to remove or add your own name prefixes here.
Parameters
- $namePrefixesarray
Usage:
/*
* Add More Name Prefixes
*/
add_filter('fluent_crm/contact_name_prefixes', function($namePrefixes) {
   $namePrefixes[] = 'Dr';
   $namePrefixes[] = 'Engg.';
   
   return $namePrefixes;
});
2
3
4
5
6
7
8
9
# fluent_crm/woo_purchase_sidebar_html
When you view a contact then it shows related woocommerce data for the contact. You may customize that here
Parameters
- $sidebarHtmlstring - HTML
- $subscriberSubscriber Model
- $pageNumberINT - Pagination Page Number
Usage:
/*
* Add Custom Data to sidebar HTML of Contact Woo Summary
*/
add_filter('fluent_crm/woo_purchase_sidebar_html', function($sidebarHtml, $subscriber, $pageNumber) {
   if(!$sidebarHtml) {
        return ''; // No info found
   }
   
   $sidebarHtml .= '<p>My custom info</p>';
}, 20, 3);
2
3
4
5
6
7
8
9
10
# fluent_crm/edd_purchase_sidebar_html
When you view a contact then it shows related Easy Digital Downloads data for the contact. You may customize that here
Parameters
- $sidebarHtmlstring - HTML
- $subscriberSubscriber Model
- $pageNumberINT - Pagination Page Number
Usage:
/*
* Add Custom Data to sidebar HTML of Contact EDD Summary
*/
add_filter('fluent_crm/edd_purchase_sidebar_html', function($sidebarHtml, $subscriber, $pageNumber) {
   if(!$sidebarHtml) {
        return ''; // No info found
   }
   
   $sidebarHtml .= '<p>My custom info</p>';
}, 20, 3);
2
3
4
5
6
7
8
9
10
# fluent_crm/bounced_email_store
This filter allows you to customize whether a bounced email should be stored in the system or not.
Parameters
- $storeboolean - Default true
Usage:
/*
* Prevent storing bounced emails in the system
*/
add_filter('fluent_crm/bounced_email_store', function($store) {
    return false; // Prevent storing bounced emails
}, 20, 3);
2
3
4
5
6
# Webhook Related Filters
# fluent_crm/incoming_webhook_data
If you want to intercept incoming Webhook before it's get validated and processed you can use this hook to format the data.
Parameters
- $postDataarray - Posted data on the webhook
- $webhookWebhook Model
- $requestRequest Object
Usage:
/*
* Customize Webhook data for webhook id: 1
*/
add_filter('fluent_crm/incoming_webhook_data', function($postedData, $webhook) {
   if($webhook->id != 1) {
        return $postedData;
   }
   
   // Customize your $postedData and return
   
    return $postedData;
}, 10, 3);
2
3
4
5
6
7
8
9
10
11
12
# fluent_crm/webhook_contact_data
FluentCRM Webhook data has been formatted at this point. If you want to alter the contact data and associated tags, lists, statuses, etc. You may use this hook
Parameters
- $dataArray - Formatted Contact data that will be used to create or update a contact
- $postedDataArray - Original Post Data
- $webhookRelated Webhook Model
Usage:
add_filter('fluent_crm/webhook_contact_data', function($data, $postedData, $webhook) {
    // Customize the $data and return
    
    return $data;
}, 10, 3);
2
3
4
5
← Actions