diff --git a/src/hooks/actions/integration.md b/src/hooks/actions/integration.md index d159ac5..a4dcd6f 100644 --- a/src/hooks/actions/integration.md +++ b/src/hooks/actions/integration.md @@ -4,6 +4,41 @@ These hooks fire during third-party integration processing — scheduled jobs, feed processing, and notifications. + + + + +This hook fires when the CleverReach feed could not fetch the account's full group (list) set, so the settings dropdown is showing fewer lists than the account actually has. + +A half-filled dropdown looks exactly like a small account, which is why this is surfaced rather than left silent. It fires only on a genuinely degraded fetch — an API error, a thrown exception, a page of unreadable rows, or the `max_pages` cap being reached while groups were still arriving. The ordinary endings (a short final page, or an API that ignores the paging parameters) do not fire it. + +**Parameters** + +- `$page` (int) The page index the fetch stopped on. `0` means the very first request failed +- `$collected` (int) How many groups were successfully collected before stopping +- `$reason` (string) Why it stopped — the API error message, the exception message, or a description such as `page 2 returned 50 unreadable rows` + +**Usage** + +```php +add_action('fluentform/cleverreach_groups_fetch_incomplete', function ($page, $collected, $reason) { + error_log(sprintf( + 'CleverReach group list incomplete: stopped on page %d with %d groups — %s', + $page, + $collected, + $reason + )); +}, 10, 3); +``` + +**Reference** + +`do_action('fluentform/cleverreach_groups_fetch_incomplete', $page, $collected, $reason);` + +This hook is located in FluentFormPro\Integrations\CleverReach\Bootstrap + + + **Description** diff --git a/src/hooks/filters/integration.md b/src/hooks/filters/integration.md index 8b311b5..c2adbcf 100644 --- a/src/hooks/filters/integration.md +++ b/src/hooks/filters/integration.md @@ -59,6 +59,49 @@ This filter is located in FluentForm\App\Hooks\actions.php + + + + +This filter tunes how the CleverReach feed fetches the account's group (list) options for the feed settings dropdown. + +CleverReach does not document paging on `/v3/groups`, so the fetch is deliberately additive: the first request carries no paging parameters, and further pages are only probed once a response comes back large enough to look capped. If the API ignores the parameters, the probe returns groups already held and the loop stops, so the result matches an unpaged fetch. + +**Parameters** + +- `$config` (array) Pagination settings + - `probe_from` (int) How many groups a response must contain before extra pages are probed. Default `50`. Any value below `1` disables probing entirely, restoring a single unpaged request. + - `max_pages` (int) Hard cap on requests per call. Default `20`. Values below `1` are clamped to `1`. + +**Usage** + +```php +add_filter('fluentform/cleverreach_groups_pagination', function ($config) { + // Never probe for extra pages — one unpaged request only. + $config['probe_from'] = 0; + + return $config; +}); +``` + +```php +add_filter('fluentform/cleverreach_groups_pagination', function ($config) { + // Large agency account: probe sooner and allow more pages. + $config['probe_from'] = 25; + $config['max_pages'] = 60; + + return $config; +}); +``` + +**Reference** + +`apply_filters('fluentform/cleverreach_groups_pagination', $config);` + +This filter is located in FluentFormPro\Integrations\CleverReach\Bootstrap + + +