NotificationChannelInterface
Interface for notification channels. Plugins implementing this interface can send notifications to their respective channel (Telegram, Pusher, WebSocket, etc).
NotificationChannelInterface::notify()
abstract public function notify(string $recipient, Milpa\Notifications\Contracts\NotificationPayloadInterface $payload): boolSend a notification through this channel.
Parameters
| Name | Type | Description |
|---|---|---|
| $recipient | string | Channel-specific recipient (e.g., chat_id for Telegram) |
| $payload | NotificationPayloadInterface | The notification data |
Returns
True if sent successfully
NotificationChannelInterface::getChannelName()
abstract public function getChannelName(): stringGet the channel identifier.
Returns
Channel name (e.g., 'telegram', 'pusher', 'websocket')
NotificationChannelInterface::supports()
abstract public function supports(string $payloadType): boolCheck if this channel supports the given payload type.
Parameters
| Name | Type | Description |
|---|---|---|
| $payloadType | string | The type of notification (e.g., 'action_result', 'alert') |