Skip to content

Notifications Actions

4 unique action hooks currently map to this category, across 6 call sites.

Hook Inventory

HookEditionCall SitesFirst Source
fluent_community_send_daily_digestCore2fluent-community/app/Hooks/Handlers/EmailNotificationHandler.php:578
fluent_community_send_daily_digest_initCore1fluent-community/app/Hooks/Handlers/Scheduler.php:60
fluent_community/email_notify_users_everyone_tagCore2fluent-community/app/Hooks/Handlers/EmailNotificationHandler.php:490
fluent_community/remove_old_notificationsCore1fluent-community/app/Hooks/Handlers/Scheduler.php:26

fluent_community_send_daily_digest

  • Type: action
  • Edition: Core
  • Call sites: 2
  • When it fires: Fires when a batch of daily digest emails is due to be sent.

Not a once-per-day event. The scheduled fluent_community_send_daily_digest_init action fires it, and the core handler then walks recipients 100 at a time, re-scheduling this same action whenever it approaches its run-time budget — so it can fire many times for a single digest run. It takes no arguments; the handler tracks its position through the last_digest_sent_user_id option.

Call Sites

EditionSourceParameters
Corefluent-community/app/Hooks/Handlers/EmailNotificationHandler.php:578No parameters
Corefluent-community/app/Hooks/Handlers/Scheduler.php:21No parameters

Example

php
add_action('fluent_community_send_daily_digest', function () {
}, 10, 0);

Related: fluent_community_scheduled_hour_jobs

fluent_community_send_daily_digest_init

  • Type: action
  • Edition: Core
  • Call sites: 1
  • When it fires: Scheduled action that kicks off a digest run at the configured day and time.

Scheduled job

This action is not fired inline. It is registered as a recurring background job and runs on a schedule, so the source below is where the job is scheduled, not where it fires. Hook it with add_action() as usual.

Note the underscore-only naming. It is a one-shot Action Scheduler entry rather than a recurring one: the hourly maintenance job re-schedules the next occurrence, and unschedules it when digests are disabled globally and no member has opted in individually. Its only job is to fire fluent_community_send_daily_digest, which is where the batching happens, so hook that one for the actual send. It takes no arguments.

Call Sites

EditionSourceParameters
Corefluent-community/app/Hooks/Handlers/Scheduler.php:60No parameters

Example

php
add_action('fluent_community_send_daily_digest_init', function () {
}, 10, 0);

Related: fluent_community_send_daily_digest · fluent_community_scheduled_hour_jobs

fluent_community/email_notify_users_everyone_tag

  • Type: action
  • Edition: Core
  • Call sites: 2
  • When it fires: Action Scheduler task that broadcasts a post to every member of its space.

Scheduled job

This action is not fired inline. It is registered as a recurring background job and runs on a schedule, so the source below is where the job is scheduled, not where it fires. Hook it with add_action() as usual.

Queued five minutes after a space admin or moderator publishes a post carrying the everyone tag. It is the wide-reach path and it deliberately ignores per-space post subscriptions — the only opt-out honoured is a member having turned off mention mail. The handler pages through recipients and re-queues itself with the cursor in the second argument, so it fires many times for one post, and it bails immediately if the corresponding space_feed/created notification row cannot be found.

Parameters

#NameTypeDescription
1$feedIdintID of the post to broadcast.
2$lastSendUserIdintHighest recipient ID already mailed; 0 on the first batch.

Call Sites

EditionSourceParameters
Corefluent-community/app/Hooks/Handlers/EmailNotificationHandler.php:490No parameters
Corefluent-community/app/Hooks/Handlers/NotificationEventHandler.php:730No parameters

Example

php
add_action('fluent_community/email_notify_users_everyone_tag', function ($feedId, $lastSendUserId) {
}, 10, 2);

Related: fluent_community/feed/scheduling_everyone_tag · fluent_community/email_notify_new_posts

fluent_community/remove_old_notifications

  • Type: action
  • Edition: Core
  • Call sites: 1
  • When it fires: Fires once a day to prune notifications older than a month.

Dispatched from the fluent_community_daily_jobs handler. The core callback deletes at most 100 rows whose updated_at is over a month old per run, so a backlog is cleared gradually rather than in one pass. It takes no arguments and runs in an Action Scheduler request, so there is no current user.

Call Sites

EditionSourceParameters
Corefluent-community/app/Hooks/Handlers/Scheduler.php:26No parameters

Example

php
add_action('fluent_community/remove_old_notifications', function () {
}, 10, 0);

Related: fluent_community_daily_jobs

FluentCommunity developer documentation