Download the PHP package jamesi/notification-bundle without Composer
On this page you can find all versions of the php package jamesi/notification-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download jamesi/notification-bundle
More information about jamesi/notification-bundle
Files in jamesi/notification-bundle
Package notification-bundle
Short Description Create an email and on-site notification/alerts system for your users
License MIT
Homepage https://github.com/jamesisaac/JamesiNotificationBundle
Informations about the package notification-bundle
NotificationBundle
This Symfony bundle allows the creation of a notification system for registered members of a site. Similar to that seen on sites like Facebook.
A Notification corresponds to an event which happened on the site which the user should be made aware about. The Notification class contains the logic to build the views needed for the Alert and email which will be sent to the user.
An Alert is an on-site notification - you should implement some section on the site where the user can see their history of Alerts, and probably let them see their unseen Alert count at all times.
The Notifier, when provided with a Notification, may fire an email and/or
Alert, depending on the user's preferences (must be implemented through
NotifiableInterface
).
Usage
-
Add the bundle to your composer.json (note: this bundle hasn't reached a stable version yet:
-
Add the bunlde to your AppKernel
-
Make your User class implement the
NotifiableInterface
: -
Create an entity which extends the provided Alert entity, give it an ID and an entity type (i.e. your User implementation) for the $user ManyToOne relationship
-
Configure the bundle in
app/config/config.yml
: -
Start creating Notification subclasses in your bundle (see
FooNotification
for an example) - In your controllers, use the
jamesi_notification.notifier
service (an instance of theNotifier
class) to send out notifications, using thenotify
method.