trait AllChannelsTraits

Trait aggregating all channel notification traits.

This trait composes specific channel notification capabilities and provides utility methods for processing alert details.

Traits

Trait for sending Mail notifications.

Trait for sending Telegram notifications.

Trait for sending Discord notifications.

Methods

void
mailAlert(AlertRecipient|object $recipient, string $type, string $message, array<string,mixed> $details = [], string|null $subject = null)

Send an alert notification via Email.

void
telegramAlert(AlertRecipient|object $recipient, string $type, string $message, array<string,mixed> $details = [], string|null $subject = null)

Send an alert notification via Telegram.

void
discordAlert(AlertRecipient|object $recipient, string $type, string $message, array<string,mixed> $details = [], string|null $subject = null)

Send an alert notification via Discord.

array
flattenAlertDetails(array $details)

Flatten a multidimensional array of alert details into a single-level array.

Details

in MailNotification at line 23
void mailAlert(AlertRecipient|object $recipient, string $type, string $message, array<string,mixed> $details = [], string|null $subject = null)

Send an alert notification via Email.

Parameters

AlertRecipient|object $recipient

The recipient object with an email address

string $type

The alert type

string $message

The alert message

array<string,mixed> $details

Additional details

string|null $subject

Optional email subject

Return Value

void

void telegramAlert(AlertRecipient|object $recipient, string $type, string $message, array<string,mixed> $details = [], string|null $subject = null)

Send an alert notification via Telegram.

Parameters

AlertRecipient|object $recipient

The recipient object containing address (chat ID) and bot config

string $type

The alert type

string $message

The alert message

array<string,mixed> $details

Additional details to format in the message

string|null $subject

Optional subject to bold at the top

Return Value

void

void discordAlert(AlertRecipient|object $recipient, string $type, string $message, array<string,mixed> $details = [], string|null $subject = null)

Send an alert notification via Discord.

Parameters

AlertRecipient|object $recipient

The recipient object containing bot config

string $type

The alert type

string $message

The alert message

array<string,mixed> $details

Additional details to include in the message

string|null $subject

Optional subject (used in message formatting)

Return Value

void

at line 29
array flattenAlertDetails(array $details)

Flatten a multidimensional array of alert details into a single-level array.

Nested keys are concatenated with dots (e.g., 'parent.child').

Parameters

array $details

The details array to flatten

Return Value

array

The flattened array with string values