---
title: "fswa_notification_channel_drivers — Filter Hook"
description: "Register your own notification channel type — a destination the rule editor offers next to Slack, email and the rest."
url: "https://wpwebhooks.org/docs/fswa-notification-channel-drivers/"
---

[WP Webhooks](https://wpwebhooks.org/) / [Docs](https://wpwebhooks.org/docs/) / fswa\_notification\_channel\_drivers

Filter since v3.3.0

# fswa\_notification\_channel\_drivers

Register your own notification channel type — a destination the rule editor offers next to Slack, email and the rest.

/ Signature

```
apply_filters( 'fswa_notification_channel_drivers', $drivers )
```

/ When it fires

Once per request, the first time the registry is read. Fields typed `secret` are encrypted at rest and never returned over the API; they arrive decrypted in `$secrets` at send time. Extend `AbstractHttpDriver` to get a `post()` helper with a 10-second timeout and one retry on 429/5xx that honours `Retry-After`, plus `plainText()`, `truncate()` and severity colours.

/ Parameters

| Name | In | Type | Req | Description |
| --- | --- | --- | --- | --- |
| $drivers | param | ChannelDriver\[\] | yes | The built-in drivers. Append an object implementing \`FlowSystems\\WebhookActions\\Services\\Notifications\\Channels\\ChannelDriver\`: \`type()\` (a slug), \`label()\`, \`description()\`, \`fields()\` (the form — each field \`{key, label, type, required, help, placeholder, default}\` with \`type\` one of \`text\`, \`secret\`, \`url\`, \`emails\`, \`number\`, \`toggle\`, \`select\`, \`textarea\`, \`credential\`) and \`send( array $message, array $config, array $secrets ): true|WP\_Error\`. |

/ Returns

`ChannelDriver[]` The driver list. A driver whose \`type()\` matches a built-in one replaces it.

/ Examples

A Matrix (Element) channel

```
use FlowSystems\WebhookActions\Services\Notifications\Channels\AbstractHttpDriver;

class Matrix_Driver extends AbstractHttpDriver {
    public function type(): string  { return 'matrix'; }
    public function label(): string { return 'Matrix'; }
    public function fields(): array {
        return [
            [ 'key' => 'homeserver', 'label' => 'Homeserver URL', 'type' => 'url', 'required' => true, 'placeholder' => 'https://matrix.example.org' ],
            [ 'key' => 'room_id', 'label' => 'Room ID', 'type' => 'text', 'required' => true ],
            [ 'key' => 'access_token', 'label' => 'Access token', 'type' => 'secret', 'required' => true ],
        ];
    }
    public function send( array $message, array $config, array $secrets ): true|\WP_Error {
        $url = rtrim( $config['homeserver'], '/' ) . '/_matrix/client/v3/rooms/' . rawurlencode( $config['room_id'] ) . '/send/m.room.message/' . wp_generate_uuid4();
        $result = $this->post( $url, [ 'msgtype' => 'm.text', 'body' => $this->plainText( $message ) ], [ 'Authorization' => 'Bearer ' . $secrets['access_token'] ], 'PUT' );
        return $this->outcome( $result );
    }
}

add_filter( 'fswa_notification_channel_drivers', function ( array $drivers ) {
    $drivers[] = new Matrix_Driver();
    return $drivers;
} );
```

/ Related

[Notifications](https://wpwebhooks.org/docs/notifications/)[fswa\_notification\_http\_args](https://wpwebhooks.org/docs/fswa-notification-http-args/)[fswa\_notification\_message](https://wpwebhooks.org/docs/fswa-notification-message/)

/Ready

## Your next automation is  
one sentence away.

[Install Plugin→](https://downloads.wordpress.org/plugin/flowsystems-webhook-actions.zip) [Try the Live Preview](https://playground.wordpress.net/?blueprint-url=https://wpwebhooks.org/blueprint.json) [See the Plugin →](https://wpwebhooks.org/wordpress-webhook-plugin/)

$ wp plugin install flowsystems-webhook-actions --activate

## Structured data

```json
{"@context":"https://schema.org","@type":"TechArticle","name":"fswa_notification_channel_drivers — Filter Hook — Webhook Actions Docs","description":"Register your own notification channel type — a destination the rule editor offers next to Slack, email and the rest.","url":"https://wpwebhooks.org/docs/fswa-notification-channel-drivers/","isPartOf":{"@type":"WebSite","name":"WP Webhooks","url":"https://wpwebhooks.org"},"about":{"@type":"SoftwareApplication","name":"Webhook Actions","applicationCategory":"WordPress Plugin"}}
```
