FluentCRM Developer Documentation

website·Indexed 38 days ago

https://developers.fluentcrm.com/

Developer resources for FluentCRM, featuring a REST API for managing SMS campaigns, commerce reports, and pro settings, as well as a Core Developer Guide with global functions for Contacts, Companies, Lists, Tags, and Event Tracking.

Tokens
242.3K
Snippets
1.5K
Records
1.8K
Agent score
69%

What's inside FluentCRM

  1. Overview of FluentCRM Action Hooks

    FluentCRM provides action hooks that allow developers to execute custom code when specific events occur within the system. These hooks can be used to modify default settings or extend the plugin's functionality. Action hooks are categorized by the following functional areas:

    • Contacts: Lifecycle, tag/list changes, status transitions, notes, custom fields, and bulk deletion.
    • Contact Activity: Email opens, link clicks, smart links, event tracking, and preference updates.
    • Campaigns: CRUD operations, scheduling, sending, archiving, and email template design.
    • Tags & Lists: Creation, update, and deletion events.
    • Email Templates: Creation, update, and duplication events.
    • Automations, Admin & Init: Plugin initialization, automation funnels, admin views, and block editor.
    • Companies: CRUD operations, status/type/category changes, and notes.
    • Frontend Pages: Double opt-in, subscription management, unsubscribe, and view-on-browser pages.
    • Integrations: Hooks for Fluent Forms, WooCommerce, SureCart, abandoned carts, and other third-party integrations.
    • Sequences & Recurring (Pro): Email sequence completion, deletion, and recurring campaign generation.
    • SMS Campaigns (Pro): SMS lifecycle, sending, delivery, opt-in/out, and provider webhooks.
  2. Overview of the FluentCRM Helper class

    The FluentCrm\App\Services\Helper class is the main utility class in FluentCRM. It provides over 50 static methods for managing contacts, email settings, SmartCodes, templates, compliance, and tracking.
    use FluentCrm\App\Services\Helper;
  3. Overview of CustomContactField utility class

    The CustomContactField class is a plain PHP utility class used to manage custom field definitions for contacts in FluentCRM. It is not an Eloquent Model and does not have its own database table. Custom field definitions are stored in WordPress options via fluentcrm_get_option('contact_custom_fields'), while the actual field values for contacts are stored in the fc_subscriber_meta table.
    $customFieldManager = new FluentCrm\App\Models\CustomContactField();
  4. Overview of FluentCRM Developer Capabilities

    FluentCRM provides a developer framework for extending its functionality through several primary mechanisms: custom automation triggers and actions, a REST API for external integrations, a system of 200+ action and filter hooks for event-driven customization, and Eloquent-style database models for manipulating contact and campaign data.
  5. Introduction to FluentCRM Query Builder

    FluentCRM provides a fluent interface for creating and running database queries, which is compatible with the PHP Laravel Framework's Query Builder. Queries are initiated using the fluentCrmDb()->table('table_name') method.
    $query = fluentCrmDb()->table('fc_contact_relation_items')
                ->select(['item_value', 'status', 'item_type'])
                ->where('provider', 'woo')
                ->whereBetween('created_at', ['2022-12-05 00:00:00', '2022-12-30 23:59:59'])
                ->when($productId, function ($query) use ($productId) {
                    return $query->where('item_id', $productId);
                })
                ->orderBy('date', 'ASC');
  6. Overview of FluentCRM String Helper (Str)

    The Str class provides a set of static utility methods for string manipulation. It is located in the \FluentCrm\Framework\Support\Str namespace.
  7. Overview of the Funnel Model

    The Funnel model manages marketing funnels within FluentCRM. It is mapped to the {wp_db_prefix}_fc_funnels table and is located in the FluentCrm\App\Models namespace. The model includes a global scope that automatically filters records by type = 'funnels', and this type is automatically set upon creation.
    use FluentCrm\App\Models\Funnel;
  8. Overview of FluentCRM Array Helper (Arr)

    The Arr class provides a suite of static utility methods for array manipulation. It is located in the FluentCrm\Framework\Support\Arr namespace.
    use FluentCrm\Framework\Support\Arr;
  9. Overview of the Campaign Model

    The Campaign model manages email campaigns in FluentCRM. It is mapped to the {wp_db_prefix}_fc_campaigns table. A global scope is applied to this model that automatically filters every query by type = 'campaign'. Submodels like FunnelCampaign override this type.
    use FluentCrm\App\Models\Campaign;
  10. Overview of the FunnelCampaign Model

    The FunnelCampaign model (FluentCrm\App\Models\FunnelCampaign) manages funnel-specific email campaigns. It extends the base Campaign model and shares the {wp_db_prefix}_fc_campaigns database table, but it is automatically scoped to records where type = 'funnel_email_campaign'. It inherits all attributes, relationships, and methods from the Campaign Model.
  11. CampaignUrlMetric Model Overview

    The CampaignUrlMetric model tracks URL interactions (clicks and unsubscribes) within campaigns. It maps to the {wp_db_prefix}_fc_campaign_url_metrics table and is located in the FluentCrm\App\Models namespace.
    use FluentCrm\App\Models\CampaignUrlMetric;