# FluentCRM Action Hooks
FluentCRM Core IntermediateFluentCRM has many interesting filter hooks that let developers change default settings and even extend FluentCRM with new functionality.
# What are Action Hooks
Action hooks are used to run custom code when certain events occur.
# Available of Action Hooks in FluentCRM
# Contact / Subscriber Specific
fluent_crm/contact_created
This action runs when a contact created
Parameters
- $subscriber Subscriber Model
Usage:
add_action('fluent_crm/contact_created', function($subscriber) {
// Do whatever you want with the newly created $subscriber
});
2
3
fluent_crm/contact_updated
This action runs when a contact created
Parameters
- $subscriber Subscriber Model
Usage:
add_action('fluent_crm/contact_updated', function($subscriber) {
// Do whatever you want with the newly created $subscriber
});
2
3
fluentcrm_contact_added_to_tags
This action runs when tags have been added to a contact
Parameters
$attachedTagIdsarray of tag ids that has been added to the contact$subscriberSubscriber Model
Usage:
add_action('fluentcrm_contact_added_to_tags', function($tagIds, $subscriber) {
// Do whatever you want here
}, 10, 2);
2
3
fluentcrm_contact_added_to_lists
This action runs when lists have been added to a contact
Parameters
$attachedListIdsarray of list ids that has been added to the contact$subscriberSubscriber Model
Usage:
add_action('fluentcrm_contact_added_to_lists', function($attachedListIds, $subscriber) {
// Do whatever you want with here
}, 10, 2);
2
3
fluentcrm_contact_removed_from_tags
This action runs when tags have been removed from a contact
Parameters
$detachedTagIdsarray of tag ids that has been removed from the contact$subscriberSubscriber Model
Usage:
add_action('fluentcrm_contact_removed_from_tags', function($detachedTagIds, $subscriber) {
// Do whatever you want with here
}, 10, 2);
2
3
fluentcrm_contact_removed_from_lists
This action runs when lists have been removed from a contact
Parameters
$detachedListIdsarray of list ids that has been removed from the contact$subscriberSubscriber Model
Usage:
add_action('fluentcrm_contact_removed_from_lists', function($detachedListIds, $subscriber) {
// Do whatever you want with here
}, 10, 2);
2
3
fluentcrm_subscriber_status_to_{$new_status}
This action hook fires when a subscriber's status has been changed to a new status
Possible Hooks
fluentcrm_subscriber_status_to_subscribedfluentcrm_subscriber_status_to_unsubscribedfluentcrm_subscriber_status_to_pendingfluentcrm_subscriber_status_to_bouncedfluentcrm_subscriber_status_to_complained
Parameters
$subscriberSubscriber Model$oldStatusstring - old status of the contact (eg: subscribed | unsubscribed | pending | bounced | complained)
Usage:
add_action('fluentcrm_subscriber_status_to_subscribed', function($subscriber, $oldStatus) {
// the subscriber got subscribed status. You can do run your code here
}, 10, 2);
2
3
fluent_crm/subscriber_unsubscribed_from_web_ui
This action hook fires when a subscriber unsubscribe from web UI. Please note that fluentcrm_subscriber_status_to_unsubscribed action also fire before this action.
Parameters
$subscriberSubscriber Model$postedDataarray - post data of the unsubscribe form as key value pair
Usage:
add_action('fluent_crm/subscriber_unsubscribed_from_web_ui', function($subscriber, $data) {
// the contact unsubscribed from web UI. Do your staffs here
}, 10, 2);
2
3
fluent_crm/subscribed_confirmed_via_double_optin
This action hook fires when a subscriber do double optin by clicking DOI link. Please note that fluentcrm_subscriber_status_to_subscribed action also fire before this action.
Parameters
$subscriberSubscriber Model
Usage:
add_action('fluent_crm/subscriber_unsubscribed_from_web_ui', function($subscriber) {
// the contact condired the subscription from web UI.
});
2
3
fluentcrm_subscriber_contact_type_to_{$new_type}
This action hook fires when a subscriber's contact_type has been changed to a new type
Possible Hooks
fluentcrm_subscriber_contact_type_to_leadfluentcrm_subscriber_contact_type_to_customer
Parameters
$subscriberSubscriber Model$oldTypestring - old type of the contact (eg: lead | customer)
Usage:
add_action('fluentcrm_subscriber_contact_type_to_customer', function($subscriber, $oldType) {
// the conact's type changed to customer. You can do run your code here
}, 10, 2);
2
3
fluent_crm/contact_email_changed
This action hook fires when a subscriber's has been changed to a new email address
Parameters
$subscriberSubscriber Model$oldEmailstring - Old Email Address
Usage:
add_action('fluent_crm/contact_email_changed', function($subscriber, $oldEmail) {
// the conact's email changed. You can do run your code here
}, 10, 2);
2
3
# Contact Activity Specifics
fluencrm_benchmark_link_clicked
This action runs when a contact created
Parameters
$benchmarkLinkIdINT - Benchmark ID$subscriberSubscriber Model or Null if not contact found
Usage:
add_action('fluencrm_benchmark_link_clicked', function($benchmarkLinkId, $subscriber) {
// Do you staffs here
});
2
3
fluent_crm/smart_link_clicked_by_contact
This action runs when a contact clicks a smartlink. This hook fires after the associate tags, lists actions fired.
Parameters
$smartLinkSmartLink Model$subscriberSubscriber Model
Usage:
add_action('fluent_crm/smart_link_clicked_by_contact', function($smartLink, $subscriber) {
// Do you staffs here
});
2
3
fluentcrm_email_url_clicked
This action runs when a contact clicks a link from email.
Parameters
$campaignEmailCampaignEmail Model$urlObjectUrl Object
Usage:
add_action('fluentcrm_email_url_clicked', function($campaignEmail, $urlObject) {
// Do you staffs here
});
2
3
fluent_crm/track_activity_by_subscriber
This action runs when a contact login to your site, click a link. This hook track the last_activity timestamp
Parameters
$subscriberINT|Subscriber Model, When use please check if it's a
Usage:
add_action('fluent_crm/track_activity_by_subscriber', function($subscriber) {
if(is_numeric($subscriber)) {
$subscriber = fluentCrmApi('contacts')->getContact($subscriber);
}
// Do you staffs
});
2
3
4
5
6
7
fluent_crm/pref_form_self_contact_updated
This action runs when a contact update his/her information in the manage subscriptions page
Parameters
$subscriberSubscriber Model$postedDataArray - key value pairs of data filled in the web form.
Usage:
add_action('fluent_crm/pref_form_self_contact_updated', function($subscriber, $postedData) {
// Do you staffs
}, 10, 2);
2
3
# List Specifics
fluent_crm/list_created
This action runs when a new list has been created
Parameters
$listModelList Model
Usage:
add_action('fluent_crm/list_created', function($listModel) {
// Do you staffs here
});
2
3
fluent_crm/list_updated
This action runs when a list has been updated
Parameters
$listModelList Model
Usage:
add_action('fluent_crm/list_updated', function($listModel) {
// Do you staffs here
});
2
3
fluent_crm/list_deleted
This action runs when a list has been updated
Parameters
$listIdINT - List ID
Usage:
add_action('fluent_crm/list_deleted', function($listId) {
// Do you staffs here
});
2
3
# Tag Specifics
fluent_crm/tag_created
This action runs when a new tag has been created
Parameters
$tagModelList Model
Usage:
add_action('fluent_crm/tag_created', function($tagModel) {
// Do you staffs here
});
2
3
fluent_crm/tag_updated
This action runs when a tag has been updated
Parameters
$tagModelTag Model
Usage:
add_action('fluent_crm/tag_updated', function($tagModel) {
// Do you staffs here
});
2
3
fluent_crm/tag_deleted
This action runs when a tag has been updated
Parameters
$tagIdINT - Tag ID
Usage:
add_action('fluent_crm/tag_deleted', function($tagId) {
// Do you staffs here
});
2
3
# Email Template Specific
fluent_crm/email_template_created
This action runs after an email template has been created
Parameters
$templateIdINT - Created Template ID$templateDataArray - Template Data as Array
Usage:
add_action('fluent_crm/email_template_created', function($templateId, $templateData) {
// Do you staffs here
}, 10, 2);
2
3
fluent_crm/email_template_duplicated
This action runs after an email template has been duplicated
Parameters
$templateIdINT - Created Template ID$oldTemplateDataArray - Original Template Data as Array
Usage:
add_action('fluent_crm/email_template_duplicated', function($templateId, $oldTemplateData) {
// Do you staffs here
}, 10, 2);
2
3
fluent_crm/email_template_updated
This action runs after an email template has been duplicated
Parameters
$templateDataarray - Update Data as key value pair$templateTemplate Model
Usage:
add_action('fluent_crm/email_template_updated', function($templateData, $template) {
// Do you staffs here
}, 10, 2);
2
3
# Email Campaign Specific
fluent_crm/campaign_created
This action runs after a campaign has been created
Parameters
$campaignCampaign Model
Usage:
add_action('fluent_crm/campaign_created', function($campaign) {
// Do you staffs here
});
2
3
fluent_crm/campaign_data_updated
This action runs after a campaign has been updated
Parameters
$campaignCampaign Model$postedDataArray - Update data
Usage:
add_action('fluent_crm/campaign_data_updated', function($campaign, $postedData) {
// Do you staffs here
}, 10, 2);
2
3
fluent_crm/campaign_deleted
This action runs after a campaign has been deleted
Parameters
$campaignIdINT - deleted campaign ID
Usage:
add_action('fluent_crm/campaign_data_updated', function($campaignId) {
// Do you staffs here
});
2
3
fluent_crm/campaign_duplicated
This action runs after a campaign has been duplicated
Parameters
$newCampaignCampaign Model - New Campaign Model$oldCampaignCampaign Model - Old Campaign Model
Usage:
add_action('fluent_crm/campaign_duplicated', function($newCampaign, $oldCampaign) {
// Do you staffs here
}, 10, 2);
2
3
fluent_crm/campaign_recipients_query_updated
This action runs when recipients is being updated
Parameters
$campaignCampaign Model
Usage:
add_action('fluent_crm/campaign_recipients_query_updated', function($campaign) {
// Do you staffs here
});
2
3
fluent_crm/campaign_scheduled
This action runs when a campaign is being scheduled
Parameters
$campaignCampaign Model$scheduleAtDate Time (Y-m-d H:i:s format)
Usage:
add_action('fluent_crm/campaign_scheduled', function($campaign, $scheduleAt) {
// Do you staffs here
}, 10, 2);
2
3
fluent_crm/campaign_set_send_now
This action runs when a campaign is set to sent immediately
Parameters
$campaignCampaign Model
Usage:
add_action('fluent_crm/campaign_set_send_now', function($campaign) {
// Do you staffs here
});
2
3
fluent_crm/campaign_processing_start
This action runs when emails of a campaigns are being started
Parameters
$campaignCampaign Model
Usage:
add_action('fluent_crm/campaign_processing_start', function($campaign) {
// Do you staffs here
});
2
3
# Automation Funnel Specific
fluent_crm/automation_funnel_start
This action runs when a funnel starts for a subscriber
Parameters
$funnelFunnel Model$subscriberSubscriber Model
Usage:
add_action('fluent_crm/automation_funnel_start', function($funnel, $subscriber) {
// Do whatever you want
}, 10, 2);
2
3
fluent_crm/automation_funnel_completed
This action runs when a funnel has been completed for a subscriber
Parameters
$funnelFunnel Model$subscriberSubscriber Model
Usage:
add_action('fluent_crm/automation_funnel_completed', function($funnel, $subscriber) {
// Do whatever you want
}, 10, 2);
2
3
# Admin App & View Specific
fluent_crm/admin_app
After Main FluentCRM Admin View
Usage:
add_action('fluent_crm/admin_app', function() {
echo 'My Custom Content Here';
});
2
3
# Email Template Design Specific
fluent_crm/email_header
If you want to add your own custom CSS for a specific email template or all email template then you can use this hook.
Parameters
$designSlugString - Design Name (classic | plain | raw_classic | simple)
Usage:
/*
* Add Custom CSS for plain design type
*/
add_action('fluent_crm/email_header', function($designName) {
if($designName == 'plain') {
?>
<style>
h1 {
color: red;
}
</style>
<?php
}
});
2
3
4
5
6
7
8
9
10
11
12
13
14
# Double Optin Confirmation Page Actions
fluent_crm/confirmation_head
This hook fires on double optin confirmation head. If you want to add any custom css or head attributes then you can use this hook.
Anything echo from this hook will be added to <head> </head> in the page
Parameters
$subscriberSubscriber Model
Usage:
/*
* Add Custom CSS for double ontin confirmation page
/*
add_action('fluent_crm/confirmation_head', function($subscriber) {
?>
<style>
# your custom css here
</style>
<?php
});
2
3
4
5
6
7
8
9
10
fluent_crm/confirmation_footer
This hook fires on double optin confirmation footer. If you want to add your own content in the double optin confirmation page then you may use this hook.
Parameters
$subscriberSubscriber Model
Usage:
/*
* Add Custom Content for double ontin confirmation page
/*
add_action('fluent_crm/confirmation_footer', function($subscriber) {
if(!$subscriber) {
return;
}
echo 'Hello '.$subscriber->first_name;
});
2
3
4
5
6
7
8
9
# Manage Subscriptions Page Actions
fluent_crm/manage_subscription_head
This hook fires on manage subscription page's head. If you want to add any custom css or head attributes then you can use this hook.
Anything echo from this hook will be added to <head> </head> in the page
Parameters
$subscriberSubscriber Model
Usage:
/*
* Add Custom CSS for manage subscription page
/*
add_action('fluent_crm/manage_subscription_head', function($subscriber) {
?>
<style>
# your custom css here
</style>
<?php
});
2
3
4
5
6
7
8
9
10
fluent_crm/manage_subscription_footer
This hook fires on manage subscription footer. If you want to add your own content in the page then you may use this hook.
Parameters
$subscriberSubscriber Model
Usage:
/*
* Add Custom content for manage subscription page
/*
add_action('fluent_crm/manage_subscription_footer', function($subscriber) {
if(!$subscriber) {
return;
}
echo 'Hello '.$subscriber->first_name;
});
2
3
4
5
6
7
8
9
# Unsubscribe Page Actions
fluent_crm/unsubscribe_head
This hook fires on Unsubscribe page's head. If you want to add any custom css or head attributes then you can use this hook.
Anything echo from this hook will be added to <head> </head> in the page
Parameters
$subscriberSubscriber Model$campaignEmailCampaignEmail Model
Usage:
/*
* Add Custom CSS for Unsubscribe page
/*
add_action('fluent_crm/unsubscribe_head', function($subscriber, $campaignEmail) {
?>
<style>
# your custom css here
</style>
<?php
}, 10, 2);
2
3
4
5
6
7
8
9
10
fluent_crm/before_unsubscribe_form
This hook fires on Unsubscribe page's before header HTML. If you want to add own HTML at the starting of the page, then you may use this hook.
Parameters
$subscriberSubscriber Model$campaignEmailCampaignEmail Model
Usage:
/*
* Add Custom Content for Unsubscribe page's before default content
/*
add_action('fluent_crm/before_unsubscribe_form', function($subscriber, $campaignEmail) {
// Add your own code here
}, 10, 2);
2
3
4
5
6
fluent_crm/before_unsubscribe_form
This hook fires on Unsubscribe page's before header HTML. If you want to add own HTML at the starting of the page, then you may use this hook.
Parameters
$subscriberSubscriber Model$campaignEmailCampaignEmail Model
Usage:
/*
* Add Custom Content for Unsubscribe page's before default content
/*
add_action('fluent_crm/before_unsubscribe_form', function($subscriber, $campaignEmail) {
// Add your own code here
}, 10, 2);
2
3
4
5
6
fluent_crm/before_unsubscribe_submit
This hook fires on Unsubscribe page's before submit HTML. If you want to add own HTML before the button, then you may use this hook.
Parameters
$subscriberSubscriber Model$campaignEmailCampaignEmail Model
Usage:
/*
* Add Custom Content for Unsubscribe page's before the button
/*
add_action('fluent_crm/before_unsubscribe_submit', function($subscriber, $campaignEmail) {
// Add your own code here
}, 10, 2);
2
3
4
5
6
fluent_crm/after_unsubscribe_content
This hook fires on Unsubscribe page's after the form content.
Parameters
$subscriberSubscriber Model$campaignEmailCampaignEmail Model
Usage:
/*
* Add Custom Content for Unsubscribe page's before the button
/*
add_action('fluent_crm/after_unsubscribe_content', function($subscriber, $campaignEmail) {
// Add your own code here
}, 10, 2);
2
3
4
5
6
fluent_crm/unsubscribe_footer
This hook fires on Unsubscribe footer. If you want to add your own content in the page then you may use this hook.
Parameters
$subscriberSubscriber Model$campaignEmailCampaignEmail Model
Usage:
/*
* Add Custom content in the unsubscribe page
/*
add_action('fluent_crm/unsubscribe_footer', function($subscriber, $campaignEmail) {
if(!$subscriber) {
return;
}
echo 'Hello '.$subscriber->first_name;
}, 10, 2);
2
3
4
5
6
7
8
9
# View On Browser Page Actions
fluent_crm/view_on_browser_head
This hook fires on View On Browser page's head. If you want to add any custom css or head attributes then you can use this hook.
Anything echo from this hook will be added to <head> </head> in the page
Parameters
$campaignEmailCampaignEmail Model
Usage:
/*
* Add Custom CSS
/*
add_action('fluent_crm/unsubscribe_head', function($campaignEmail) {
?>
<style>
# your custom css here
</style>
<?php
});
2
3
4
5
6
7
8
9
10
fluent_crm/view_on_browser_before_heading
This hook fires on View On Browser page's before header HTML. If you want to add own HTML at the starting of the page, then you may use this hook.
Parameters
$campaignEmailCampaignEmail Model
Usage:
/*
* Add Custom Content for View On Browser page's before default content
/*
add_action('fluent_crm/view_on_browser_before_heading', function($campaignEmail) {
// Add your own code here
});
2
3
4
5
6
fluent_crm/view_on_browser_before_email_body
This hook fires on View On Browser page's before header HTML. If you want to add own HTML before the email content, then you may use this hook.
Parameters
$campaignEmailCampaignEmail Model
Usage:
/*
* Add Custom Content before email body
/*
add_action('fluent_crm/view_on_browser_before_email_body', function($campaignEmail) {
// Add your own code here
});
2
3
4
5
6
fluent_crm/view_on_browser_after_email_body
This hook fires on View On Browser page's after email body HTML.
Parameters
$campaignEmailCampaignEmail Model
Usage:
/*
* Add Custom Content for after email body
/*
add_action('fluent_crm/view_on_browser_after_email_body', function($campaignEmail) {
// Add your own code here
});
2
3
4
5
6
fluent_crm/view_on_browser_footer
This hook fires on Unsubscribe footer. If you want to add your own content in the page then you may use this hook.
Parameters
$campaignEmailCampaignEmail Model
Usage:
/*
* Add Custom content at the footer of the page
/*
add_action('fluent_crm/view_on_browser_footer', function($campaignEmail) {
// add your code here
}, 10, 2);
2
3
4
5
6
# Fluent Forms - Contact Specific
fluent_crm/contact_added_by_fluentform
This action runs when a contact has been added via Fluent Forms
Parameters
$subscriberSubscriber Model$entryArray$formObject$feedArray
Usage:
add_action('fluent_crm/contact_added_by_fluentform', function($subscriber, $entry, $form, $feed) {
// Do whatever you want with the $subscriber created by Fluent Forms
}, 10, 4);
2
3
fluent_crm/contact_updated_by_fluentform
This action runs when a contact has been updated via Fluent Forms
Parameters
$subscriberSubscriber Model$entryArray$formObject$feedArray
Usage:
add_action('fluent_crm/contact_updated_by_fluentform', function($subscriber, $entry, $form, $feed) {
// Do whatever you want with the $subscriber updated via Fluent Forms
}, 10, 4);
2
3
Filters →