PHPackages                             symfony-bro/notification-core - 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. [Mail &amp; Notifications](/categories/mail)
4. /
5. symfony-bro/notification-core

ActiveLibrary[Mail &amp; Notifications](/categories/mail)

symfony-bro/notification-core
=============================

Schedule bundle

0.4.4(7y ago)3352PHPPHP &gt;=7.1

Since May 19Pushed 7y ago2 watchersCompare

[ Source](https://github.com/symfony-bro/notification-core)[ Packagist](https://packagist.org/packages/symfony-bro/notification-core)[ RSS](/packages/symfony-bro-notification-core/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (3)Versions (18)Used By (2)

Introduction
============

[](#introduction)

This library is provided to abstract transport layer of notification process.

Architecture
============

[](#architecture)

Transport layer
---------------

[](#transport-layer)

The main abstraction of the transport layer is `\SymfonyBro\NotificationCore\Model\NotificationManagerInterface`with only method `notify(NotificationInterface $notification)`. The idea is that we should create a notification object for some event and send it with notification manager. So, client code knows nothing about how notification will be send.

We've created an abstract implementation for this interface — `\SymfonyBro\NotificationCore\Model\AbstractNotificationManager`. Internally it delegates job to formatter and driver objects.

### Driver

[](#driver)

Driver object implements `\SymfonyBro\NotificationCore\Model\DriverInterface`and responsible for sending a message. Message is another object implements `\SymfonyBro\NotificationCore\Model\MessageInterface` related to a specific driver. For example we have SwiftMailerDriver out of the box and it can send SwiftMailerMessage. But where do we get a message object?

### Formatter

[](#formatter)

There is formatter object which implements `\SymfonyBro\NotificationCore\Model\FormatterInterface`. The only purpose of formatter is creating a message object from a notification object.

### Examples

[](#examples)

Say, we have to send an email to the client if he makes new order. Suppose you already have some observer pattern implementation and you have listener for new order event. First we should create new notification class for this event:

```
