Skip to content

8lines/sylius-notification-plugin-slack-adapter

Repository files navigation

8lines

SyliusNotificationPlugin

Slack Notification Channel Adapter


Table of Content

Overview

This package is an adapter for the SyliusNotificationPlugin that allows you to send notifications to Slack.

Installation

To install the adapter you need to run the following command:

composer require 8lines/sylius-notification-plugin-slack-adapter

Then configure Slack Notifier and add the following variable to your .env file:

SLACK_DSN=slack://TOKEN@default?channel=CHANNEL

And finally, add the following configuration to your config/packages/notifier.yaml file:

framework:
  notifier:
    chatter_transports:
      slack: '%env(SLACK_DSN)%'

Usage

After the installation, you can use the Slack Notification Channel in your application. There are one additional option that you can specify during the notification creation:

  • recipient - the channel to which the notification will be sent. It can be either a channel name or a channel ID. If not specified, the notification will be sent to the default channel.