# FluentCRM Action Hooks

FluentCRM Core Intermediate

FluentCRM 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
});
1
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
});
1
2
3
fluentcrm_contact_added_to_tags

This action runs when tags have been added to a contact

Parameters

  • $attachedTagIds array of tag ids that has been added to the contact
  • $subscriber Subscriber Model

Usage:

add_action('fluentcrm_contact_added_to_tags', function($tagIds, $subscriber) {
   // Do whatever you want here
}, 10, 2);
1
2
3
fluentcrm_contact_added_to_lists

This action runs when lists have been added to a contact

Parameters

  • $attachedListIds array of list ids that has been added to the contact
  • $subscriber Subscriber Model

Usage:

add_action('fluentcrm_contact_added_to_lists', function($attachedListIds, $subscriber) {
   // Do whatever you want with here
}, 10, 2);
1
2
3
fluentcrm_contact_removed_from_tags

This action runs when tags have been removed from a contact

Parameters

  • $detachedTagIds array of tag ids that has been removed from the contact
  • $subscriber Subscriber Model

Usage:

add_action('fluentcrm_contact_removed_from_tags', function($detachedTagIds, $subscriber) {
   // Do whatever you want with here
}, 10, 2);
1
2
3
fluentcrm_contact_removed_from_lists

This action runs when lists have been removed from a contact

Parameters

  • $detachedListIds array of list ids that has been removed from the contact
  • $subscriber Subscriber Model

Usage:

add_action('fluentcrm_contact_removed_from_lists', function($detachedListIds, $subscriber) {
   // Do whatever you want with here
}, 10, 2);
1
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_subscribed
  • fluentcrm_subscriber_status_to_unsubscribed
  • fluentcrm_subscriber_status_to_pending
  • fluentcrm_subscriber_status_to_bounced
  • fluentcrm_subscriber_status_to_complained

Parameters

  • $subscriber Subscriber Model
  • $oldStatus string - 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);
1
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

  • $subscriber Subscriber Model
  • $postedData array - 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);
1
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

  • $subscriber Subscriber Model

Usage:

add_action('fluent_crm/subscriber_unsubscribed_from_web_ui', function($subscriber) {
   // the contact condired the subscription from web UI.
});
1
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_lead
  • fluentcrm_subscriber_contact_type_to_customer

Parameters

  • $subscriber Subscriber Model
  • $oldType string - 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);
1
2
3
fluent_crm/contact_email_changed

This action hook fires when a subscriber's has been changed to a new email address

Parameters

  • $subscriber Subscriber Model
  • $oldEmail string - 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);
1
2
3

# Contact Activity Specifics


fluencrm_benchmark_link_clicked

This action runs when a contact created

Parameters

  • $benchmarkLinkId INT - Benchmark ID
  • $subscriber Subscriber Model or Null if not contact found

Usage:

add_action('fluencrm_benchmark_link_clicked', function($benchmarkLinkId, $subscriber) {
   // Do you staffs here
});
1
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

  • $smartLink SmartLink Model
  • $subscriber Subscriber Model

Usage:

add_action('fluent_crm/smart_link_clicked_by_contact', function($smartLink, $subscriber) {
   // Do you staffs here
});
1
2
3
fluentcrm_email_url_clicked

This action runs when a contact clicks a link from email.

Parameters

  • $campaignEmail CampaignEmail Model
  • $urlObject Url Object

Usage:

add_action('fluentcrm_email_url_clicked', function($campaignEmail, $urlObject) {
   // Do you staffs here
});
1
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

  • $subscriber INT|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
});
1
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

  • $subscriber Subscriber Model
  • $postedData Array - 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);
1
2
3

# List Specifics


fluent_crm/list_created

This action runs when a new list has been created

Parameters

  • $listModel List Model

Usage:

add_action('fluent_crm/list_created', function($listModel) {
   // Do you staffs here
});
1
2
3
fluent_crm/list_updated

This action runs when a list has been updated

Parameters

  • $listModel List Model

Usage:

add_action('fluent_crm/list_updated', function($listModel) {
   // Do you staffs here
});
1
2
3
fluent_crm/list_deleted

This action runs when a list has been updated

Parameters

  • $listId INT - List ID

Usage:

add_action('fluent_crm/list_deleted', function($listId) {
   // Do you staffs here
});
1
2
3

# Tag Specifics


fluent_crm/tag_created

This action runs when a new tag has been created

Parameters

  • $tagModel List Model

Usage:

add_action('fluent_crm/tag_created', function($tagModel) {
   // Do you staffs here
});
1
2
3
fluent_crm/tag_updated

This action runs when a tag has been updated

Parameters

  • $tagModel Tag Model

Usage:

add_action('fluent_crm/tag_updated', function($tagModel) {
   // Do you staffs here
});
1
2
3
fluent_crm/tag_deleted

This action runs when a tag has been updated

Parameters

  • $tagId INT - Tag ID

Usage:

add_action('fluent_crm/tag_deleted', function($tagId) {
   // Do you staffs here
});
1
2
3

# Email Template Specific


fluent_crm/email_template_created

This action runs after an email template has been created

Parameters

  • $templateId INT - Created Template ID
  • $templateData Array - Template Data as Array

Usage:

add_action('fluent_crm/email_template_created', function($templateId, $templateData) {
   // Do you staffs here
}, 10, 2);
1
2
3
fluent_crm/email_template_duplicated

This action runs after an email template has been duplicated

Parameters

  • $templateId INT - Created Template ID
  • $oldTemplateData Array - Original Template Data as Array

Usage:

add_action('fluent_crm/email_template_duplicated', function($templateId, $oldTemplateData) {
   // Do you staffs here
}, 10, 2);
1
2
3
fluent_crm/email_template_updated

This action runs after an email template has been duplicated

Parameters

  • $templateData array - Update Data as key value pair
  • $template Template Model

Usage:

add_action('fluent_crm/email_template_updated', function($templateData, $template) {
   // Do you staffs here
}, 10, 2);
1
2
3

# Email Campaign Specific


fluent_crm/campaign_created

This action runs after a campaign has been created

Parameters

  • $campaign Campaign Model

Usage:

add_action('fluent_crm/campaign_created', function($campaign) {
   // Do you staffs here
});
1
2
3
fluent_crm/campaign_data_updated

This action runs after a campaign has been updated

Parameters

  • $campaign Campaign Model
  • $postedData Array - Update data

Usage:

add_action('fluent_crm/campaign_data_updated', function($campaign, $postedData) {
   // Do you staffs here
}, 10, 2);
1
2
3
fluent_crm/campaign_deleted

This action runs after a campaign has been deleted

Parameters

  • $campaignId INT - deleted campaign ID

Usage:

add_action('fluent_crm/campaign_data_updated', function($campaignId) {
   // Do you staffs here
});
1
2
3
fluent_crm/campaign_duplicated

This action runs after a campaign has been duplicated

Parameters

  • $newCampaign Campaign Model - New Campaign Model
  • $oldCampaign Campaign Model - Old Campaign Model

Usage:

add_action('fluent_crm/campaign_duplicated', function($newCampaign, $oldCampaign) {
   // Do you staffs here
}, 10, 2);
1
2
3
fluent_crm/campaign_recipients_query_updated

This action runs when recipients is being updated

Parameters

  • $campaign Campaign Model

Usage:

add_action('fluent_crm/campaign_recipients_query_updated', function($campaign) {
   // Do you staffs here
});
1
2
3
fluent_crm/campaign_scheduled

This action runs when a campaign is being scheduled

Parameters

  • $campaign Campaign Model
  • $scheduleAt Date Time (Y-m-d H:i:s format)

Usage:

add_action('fluent_crm/campaign_scheduled', function($campaign, $scheduleAt) {
   // Do you staffs here
}, 10, 2);
1
2
3
fluent_crm/campaign_set_send_now

This action runs when a campaign is set to sent immediately

Parameters

  • $campaign Campaign Model

Usage:

add_action('fluent_crm/campaign_set_send_now', function($campaign) {
   // Do you staffs here
});
1
2
3
fluent_crm/campaign_processing_start

This action runs when emails of a campaigns are being started

Parameters

  • $campaign Campaign Model

Usage:

add_action('fluent_crm/campaign_processing_start', function($campaign) {
   // Do you staffs here
});
1
2
3

# Automation Funnel Specific


fluent_crm/automation_funnel_start

This action runs when a funnel starts for a subscriber

Parameters

  • $funnel Funnel Model
  • $subscriber Subscriber Model

Usage:

add_action('fluent_crm/automation_funnel_start', function($funnel, $subscriber) {
   // Do whatever you want
}, 10, 2);
1
2
3
fluent_crm/automation_funnel_completed

This action runs when a funnel has been completed for a subscriber

Parameters

  • $funnel Funnel Model
  • $subscriber Subscriber Model

Usage:

add_action('fluent_crm/automation_funnel_completed', function($funnel, $subscriber) {
   // Do whatever you want
}, 10, 2);
1
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';
});
1
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

  • $designSlug String - 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
   }
});
1
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

  • $subscriber Subscriber 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
});
1
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

  • $subscriber Subscriber 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;
});
1
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

  • $subscriber Subscriber 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
});
1
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

  • $subscriber Subscriber 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;
});
1
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

  • $subscriber Subscriber Model
  • $campaignEmail CampaignEmail 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);
1
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

  • $subscriber Subscriber Model
  • $campaignEmail CampaignEmail 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);
1
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

  • $subscriber Subscriber Model
  • $campaignEmail CampaignEmail 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);
1
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

  • $subscriber Subscriber Model
  • $campaignEmail CampaignEmail 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);
1
2
3
4
5
6
fluent_crm/after_unsubscribe_content

This hook fires on Unsubscribe page's after the form content.

Parameters

  • $subscriber Subscriber Model
  • $campaignEmail CampaignEmail 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);
1
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

  • $subscriber Subscriber Model
  • $campaignEmail CampaignEmail 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);
1
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

  • $campaignEmail CampaignEmail Model

Usage:

/*
* Add Custom CSS
/*
add_action('fluent_crm/unsubscribe_head', function($campaignEmail) {
   ?>
   <style>
       # your custom css here
   </style>
   <?php
});
1
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

  • $campaignEmail CampaignEmail 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
});
1
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

  • $campaignEmail CampaignEmail 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
});
1
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

  • $campaignEmail CampaignEmail 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
});
1
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

  • $campaignEmail CampaignEmail 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);
1
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

  • $subscriber Subscriber Model
  • $entry Array
  • $form Object
  • $feed Array

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);
1
2
3
fluent_crm/contact_updated_by_fluentform

This action runs when a contact has been updated via Fluent Forms

Parameters

  • $subscriber Subscriber Model
  • $entry Array
  • $form Object
  • $feed Array

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);
1
2
3