PHPackages                             snebes/notifications-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. snebes/notifications-bundle

ActiveSymfony-bundle[Database &amp; ORM](/categories/database)

snebes/notifications-bundle
===========================

A snebes/notifications bundle integration for Symfony projects

v1.0.0(6y ago)419MITPHPPHP ^7.1.3CI failing

Since Sep 18Pushed 6y ago1 watchersCompare

[ Source](https://github.com/snebes/notifications-bundle)[ Packagist](https://packagist.org/packages/snebes/notifications-bundle)[ RSS](/packages/snebes-notifications-bundle/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (1)Dependencies (9)Versions (2)Used By (0)

snebes/notifications-bundle
===========================

[](#snebesnotifications-bundle)

[![GitHub release](https://camo.githubusercontent.com/e8ac6b08e5310308221af813d960943274e0ca7b3697058c8fd7b07897dabff2/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f736e656265732f6e6f74696669636174696f6e732d62756e646c65)](https://camo.githubusercontent.com/e8ac6b08e5310308221af813d960943274e0ca7b3697058c8fd7b07897dabff2/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f736e656265732f6e6f74696669636174696f6e732d62756e646c65)[![GitHub license](https://camo.githubusercontent.com/bb8b43c368654f500389f55b04b589137fea6fc371a0a431087ce87d6410757b/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f736e656265732f6e6f74696669636174696f6e732d62756e646c65)](https://github.com/snebes/notifications-bundle/blob/master/LICENSE)[![Scrutinizer build](https://camo.githubusercontent.com/8f3b55b2e8503847baeed5c2b35eaf556f9e8a94072777e3df099c1fcd37e37f/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f6275696c642f672f736e656265732f6e6f74696669636174696f6e732d62756e646c65)](https://camo.githubusercontent.com/8f3b55b2e8503847baeed5c2b35eaf556f9e8a94072777e3df099c1fcd37e37f/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f6275696c642f672f736e656265732f6e6f74696669636174696f6e732d62756e646c65)[![Scrutinizer coverage](https://camo.githubusercontent.com/410f8027c65f7b57e968d0a9098611c5e5d195923f96693f4b0eba623eaa29a7/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f736e656265732f6e6f74696669636174696f6e732d62756e646c65)](https://camo.githubusercontent.com/410f8027c65f7b57e968d0a9098611c5e5d195923f96693f4b0eba623eaa29a7/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f736e656265732f6e6f74696669636174696f6e732d62756e646c65)[![Scrutinizer code quality](https://camo.githubusercontent.com/62417853d31ddcbd55491d32e4143a255a4ad3990f7803e33e272d1b7b94901f/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f7175616c6974792f672f736e656265732f6e6f74696669636174696f6e732d62756e646c653f6c6f676f3d7363727574696e697a6572)](https://camo.githubusercontent.com/62417853d31ddcbd55491d32e4143a255a4ad3990f7803e33e272d1b7b94901f/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f7175616c6974792f672f736e656265732f6e6f74696669636174696f6e732d62756e646c653f6c6f676f3d7363727574696e697a6572)[![PHP](https://camo.githubusercontent.com/50b5af4bc9d5efefb8bafe9c24acc62ec381e6a8184025bf9da07187cfe659bf/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f7068702d762f736e656265732f6e6f74696669636174696f6e732d62756e646c65)](https://camo.githubusercontent.com/50b5af4bc9d5efefb8bafe9c24acc62ec381e6a8184025bf9da07187cfe659bf/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f7068702d762f736e656265732f6e6f74696669636174696f6e732d62756e646c65)

The `snebes/notifications-bundle` provides a [snebes/notifications](https://www.github.com/snebes/notifications) integration for your Symfony projects. Notifications is an abstraction layer, inspired by [Laravel](https://laravel.com), which allows you to easily add support for email and web-interface messaging.

A demo Symfony application with this bundle pre-installed is available. Check out [snebes/notifications-demo](https://github.com/snebes/notifications-demo).

Prerequisites
-------------

[](#prerequisites)

This bundle requires Symfony 3.4+ and utilized `doctrine/doctrine-bundle` and `symfony/swiftmailer-bundle` to provide notifications.

Installation
------------

[](#installation)

Add `snebes/notifications-bundle` to your `composer.json` file:

```
composer require snebes/notifications-bundle
```

##### Register the bundle:

[](#register-the-bundle)

##### Symfony 3:

[](#symfony-3)

Register bundle in `app/AppKernel.php`:

```
public function registerBundles()
{
    return array(
        // ...
        new SN\Bundle\NotificationsBundle\SNNotificationsBundle(),
    );
}
```

##### Symfony 4:

[](#symfony-4)

Register bundle in `config/bundles.php`. Flex will do this for you.

```
return [
    // ...
    SN\Bundle\NotificationsBundle\SNNotificationsBundle::class => ['all' => true],
];
```

Creating Notifications
----------------------

[](#creating-notifications)

Each notification is represented by a single class (typically stored in the `src/Notifications` directory). Don't worry if you don't see this directory in your application, it will be created for you when you run the make:sn:notification command:

```
bin/console make:sn:notification
```

This command will place a new notification class in your `src/Notifications` directory. Each notification class contains a `via` method and a variable number of message building methods (such as `toMail` or `toArray`) that convert the notification to a message optimized for that particular channel.

Sending Notifications
---------------------

[](#sending-notifications)

Notifications may be sent by the `NotificationSender` service.

```
