Notifications

8 events in this category

stormnodes:admin:notifications:notification:created

Callback parameters: array notification data.

onNotificationCreated

Event Data Structure

This event receives the following data when emitted:

created_by
notification_data
notification_id

Emitted from:

backend/app/Controllers/Admin/NotificationsController.php

Usage Example

use App\Plugins\PluginEvents;
use App\Plugins\Events\Events\NotificationsEvent;

public static function processEvents(PluginEvents $evt): void
{
    $evt->on(NotificationsEvent::onNotificationCreated(), function ($createdBy, $notificationData, $notificationId) {
        // Handle stormnodes:admin:notifications:notification:created
        // Data keys: created_by, notification_data, notification_id
    });
}

stormnodes:admin:notifications:notification:deleted

Callback parameters: int notification id, array notification data.

onNotificationDeleted

Event Data Structure

This event receives the following data when emitted:

deleted_by
notification_data
notification_id

Emitted from:

backend/app/Controllers/Admin/NotificationsController.php

Usage Example

use App\Plugins\PluginEvents;
use App\Plugins\Events\Events\NotificationsEvent;

public static function processEvents(PluginEvents $evt): void
{
    $evt->on(NotificationsEvent::onNotificationDeleted(), function ($deletedBy, $notificationData, $notificationId) {
        // Handle stormnodes:admin:notifications:notification:deleted
        // Data keys: deleted_by, notification_data, notification_id
    });
}

stormnodes:user:notifications:notification:dismissed

Callback parameters: int notification id, int user id.

onNotificationDismissed

Event Data Structure

This event receives the following data when emitted:

notification_id
user
user_id

Emitted from:

backend/app/Controllers/User/NotificationController.php

Usage Example

use App\Plugins\PluginEvents;
use App\Plugins\Events\Events\NotificationsEvent;

public static function processEvents(PluginEvents $evt): void
{
    $evt->on(NotificationsEvent::onNotificationDismissed(), function ($notificationId, $user, $userId) {
        // Handle stormnodes:user:notifications:notification:dismissed
        // Data keys: notification_id, user, user_id
    });
}

stormnodes:admin:notifications:notification:not:found

Callback parameters: int notification id, string error message.

onNotificationNotFound

Event Data Structure

This event receives the following data when emitted:

error_message
notification_id

Emitted from:

backend/app/Controllers/Admin/NotificationsController.php

Usage Example

use App\Plugins\PluginEvents;
use App\Plugins\Events\Events\NotificationsEvent;

public static function processEvents(PluginEvents $evt): void
{
    $evt->on(NotificationsEvent::onNotificationNotFound(), function ($errorMessage, $notificationId) {
        // Handle stormnodes:admin:notifications:notification:not:found
        // Data keys: error_message, notification_id
    });
}

stormnodes:admin:notifications:notification:retrieved

Callback parameters: int notification id, array notification data.

onNotificationRetrieved

Event Data Structure

This event receives the following data when emitted:

notification_data
notification_id

Emitted from:

backend/app/Controllers/Admin/NotificationsController.php

Usage Example

use App\Plugins\PluginEvents;
use App\Plugins\Events\Events\NotificationsEvent;

public static function processEvents(PluginEvents $evt): void
{
    $evt->on(NotificationsEvent::onNotificationRetrieved(), function ($notificationData, $notificationId) {
        // Handle stormnodes:admin:notifications:notification:retrieved
        // Data keys: notification_data, notification_id
    });
}

stormnodes:admin:notifications:error

Callback parameters: string error message, array context.

onNotificationsError

Usage Example

use App\Plugins\PluginEvents;
use App\Plugins\Events\Events\NotificationsEvent;

public static function processEvents(PluginEvents $evt): void
{
    $evt->on(NotificationsEvent::onNotificationsError(), function ($message, $context) {
        // Handle stormnodes:admin:notifications:error
        // Parameters: string error message, array context.
    });
}

stormnodes:admin:notifications:retrieved

Callback parameters: array notifications list.

onNotificationsRetrieved

Event Data Structure

This event receives the following data when emitted:

filters
limit
notifications
page
pagination
search
total
type

Emitted from:

backend/app/Controllers/Admin/NotificationsController.php

Usage Example

use App\Plugins\PluginEvents;
use App\Plugins\Events\Events\NotificationsEvent;

public static function processEvents(PluginEvents $evt): void
{
    $evt->on(NotificationsEvent::onNotificationsRetrieved(), function ($filters, $limit, $notifications, $page, $pagination, $search, $total, $type) {
        // Handle stormnodes:admin:notifications:retrieved
        // Data keys: filters, limit, notifications, page, pagination, search, total, type
    });
}

stormnodes:admin:notifications:notification:updated

Callback parameters: int notification id, array old data, array new data.

onNotificationUpdated

Event Data Structure

This event receives the following data when emitted:

new_data
notification_id
old_data
updated_by

Emitted from:

backend/app/Controllers/Admin/NotificationsController.php

Usage Example

use App\Plugins\PluginEvents;
use App\Plugins\Events\Events\NotificationsEvent;

public static function processEvents(PluginEvents $evt): void
{
    $evt->on(NotificationsEvent::onNotificationUpdated(), function ($newData, $notificationId, $oldData, $updatedBy) {
        // Handle stormnodes:admin:notifications:notification:updated
        // Data keys: new_data, notification_id, old_data, updated_by
    });
}