Developed with love by KnpLabs Hire us for your project!
61

notification-bundle

by maximilienGilet

A simple Symfony bundle to notify user

mgilet/notification-bundle

An easy yet powerful notification bundle for Symfony





Create and manage notifications in an efficient way.

Symfony support :
* 2.7.x
* 2.8.x
* 3.x

Features

  • Easy setup
  • Easy to use
  • Powerful notification management
  • Simple Twig render methods
  • Fully customizable
  • Multiple notifiables entities
  • No bloated dependencies (little requirements)

Notice: Only Doctrine ORM is supported for now.

Installation & usage

Installation

This bundle is available on packagist.

First :

$ composer require mgilet/notification-bundle

See documentation for next steps

Basic usage

class MyController extends Controller
{

    ...

    public function sendNotification(Request $request)
    {
       $manager = $this->get('mgilet.notification');
      $notif = $manager->createNotification('Hello world !');
      $notif->setMessage('This a notification.');
      $notif->setLink('http://symfony.com/');
      // or the one-line method :
      // $manager->createNotification('Notification subject','Some random text','http://google.fr');

      // you can add a notification to a list of entities
      // the third parameter `$flush` allows you to directly flush the entities
      $manager->addNotification(array($this->getUser()), $notif, true);

      ...
    }

See HERE for more

Translations

For now this bundle is only translated to de, en, es, fr, it.

Help me improve this by submitting your translations.

Community

You can help make this bundle better by contributing (every pull request will be considered) or submitting an issue.

Enjoy and share if you like it.

Licence

MIT

The MIT License (MIT)

Copyright (c) 2016 Maximilien Gilet

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
  • Merge pull request #29 from leandro980/patch-1
    By web-flow, 7 months ago
  • Update MgiletNotificationBundle.it.yml
    By web-flow, 7 months ago
  • Merge pull request #27 from 4ssil/patch-1
    By web-flow, 10 months ago
  • Merge pull request #22 from nreynis/hotfix/#21
    By web-flow, 10 months ago
  • Update usage.rst
    By web-flow, 10 months ago
  • Fix #21: do not trigger lazy loading on notifications
    By Nicolas Reynis, 10 months ago
  • Removed ReadTheDocs build files
    By Gilet Maximilien, 1 year ago
  • Fix event dispatch
    By Gilet Maximilien, 1 year ago
  • Update documentation path
    By maximilienGilet, 1 year ago
  • Add ReadTheDocs config
    By maximilienGilet, 1 year ago
  • Remove "repository" element in composer.json - fixes SensioLab analysis
    By web-flow, 1 year ago
  • WIP - Update documentation - usage
    By web-flow, 1 year ago
  • Update documentation - index
    By web-flow, 1 year ago
  • Fix cascade persist
    By Gilet Maximilien, 1 year ago
  • Merge pull request #13 from peyman-mohamadpour/master
    By web-flow, 1 year ago
  • Add Persian translation
    By , 1 year ago
  • Update doc - removed old bits
    By web-flow, 1 year ago
  • Update README, fix documentation location
    By web-flow, 1 year ago
  • Merge pull request #12 from KhanMaytok/patch-3
    By web-flow, 1 year ago
  • Update index.rst
    By web-flow, 1 year ago
  • Merge pull request #11 from MatthieuMota/patch-1
    By web-flow, 1 year ago
  • Fix documentation bad location interface
    By web-flow, 1 year ago
  • Fix creating proxies when adding notification to proxy class
    By Gilet Maximilien, 1 year ago
  • Fix previous commit
    By Gilet Maximilien, 1 year ago
  • Fix case when NotifiableInterface is a Proxy
    By Gilet Maximilien, 1 year ago
  • Merge branch 'dev' of https://github.com/maximilienGilet/notification-bundle into dev
    By Maximilien Gilet, 1 year ago
  • Fix typo
    By Maximilien Gilet, 1 year ago
  • Update documentation
    By Maximilien Gilet, 1 year ago
  • Bundle refactored from scratch
    By Maximilien Gilet, 1 year ago
  • [+] Event dispatch
    By Maximilien Gilet, 1 year ago