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

ActiveClaroline-core[Mail &amp; Notifications](/categories/mail)

icap/notification-bundle
========================

Notification bundle for Claroline Connect. See https://github.com/claroline/Claroline

v6.1.0(10y ago)32.7k66PHPPHP &gt;=5.4.1

Since Jan 29Pushed 10y ago5 watchersCompare

[ Source](https://github.com/iCAPLyon1/NotificationBundle)[ Packagist](https://packagist.org/packages/icap/notification-bundle)[ Docs](http://www.claroline.net)[ RSS](/packages/icap-notification-bundle/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (10)Dependencies (1)Versions (30)Used By (6)

NotificationBundle
==================

[](#notificationbundle)

WARNING
-------

[](#warning)

**DEVELOPMENT HAS MOVED TO [claroline/Distribution](http://github.com/claroline/Distribution). THIS REPOSITORY IS NO LONGER MAINTAINED.**

---

Notification bundle for Claroline Connect. See

[Here](https://github.com/iCAPLyon1/NotificationBundle/blob/master/Resources/doc/system_description.md) is an analysis of what the Notification system does.

[![Notification dropdown](Resources/doc/img/notifications_dropdown.jpg "Notification dropdown")](Resources/doc/img/notifications_dropdown.jpg)

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

[](#installation)

This bundle completes the Core bundle. It is needed so the system can generate notifications.

Via composer:

`composer require icap/notification-bundle "dev-master"`

Configuration
-------------

[](#configuration)

- After installation, an Notification configuration admin tool has been added which allow as to set the following:
    - the maximum number of notifications per page in notification list page (default 50)
    - the number of notifications present in the dropdown list (default 10)
    - activate the automatic cleanup of notification items after x days
    - the number of days after which a notification is deleted

How to use in plugins
---------------------

[](#how-to-use-in-plugins)

In order to integrate and enable notifications in a Claroline connect plugin you need to follow these steps:

1. Add `{% render controller('IcapNotificationBundle:FollowerResource:renderForm', {'resourceId': _resource.resourceNode.id, 'resourceClass': _resource.resourceNode.class}) %}`somewhere in your interface to render the button that allows user to enable and disable notifications for a resource. As you can see, 2 parameters are required, the resource node id and the resource node class.

    [![enable notification button](Resources/doc/img/follow_button.jpg "enable notification button")](Resources/doc/img/follow_button.jpg)
2. Any event that you want to generate a notification needs to implement the *NotifiableInterface*. This interface has 9 methods.

    - getSendToFollowers() : returns true or false if event can notify the resource's followers
    - getIncludeUserIds() : returns a list of User ids that will receive the notification (extra Users that are not necessarily in followers list)
    - getExcludeUserIds() : returns a list of User ids that must not receive the notification (this Users can be either in followers list or includeUsers list)
    - getDoer() : returns the User whose action raised the notification (this method already exists in LogGenericEvent class)
    - getActionKey() : returns a sting with the name/key of the action performed
    - getIconKey() : returns a string, usually the name of the resource type e.g. "wiki" and is used to generate a color for every notification that has the same icon name. This color is the mini icon's background color and as text content for this icon is used the first letter of the icon key.
    - getResource() : returns the resource on which the action was performed (this method already exists in LogGenericEvent class)
    - getNotificationDetails() : returns an array (JsonArray in database) which contains informations about the resource name, id and type as well as other information, necessary to render the notification text. All the information about the "doer" are added by the Notification plugin automatically. All the rest (resource, etc.) need to be added manually.
    - isAllowedToNotify() : returns true or false and informs CoreBundle that this event raises or not a notification. It can test a condition and if this condition fails no notification is created or sent, else if condition is fulfilled a notification is created and sent to users.

    You can use the example of the [LogContributionCreateEvent](https://github.com/iCAPLyon1/WikiBundle/blob/master/Event/Log/LogContributionCreateEvent.php) in the WikiBundle to guide you.
3. Create a domain for translations under translations folder following the name pattern `notification.lang.yml`
4. Under views folder create a `Notification` folder and store inside all views related to notifications' display/rendering. It is recommended to create a general twig file say `notification_item.html.twig` which will extend the `IcapNotificationBundle:Templates:notification.html.twig` template, will render all common elements and include any other necessary template according to the action type. An example is given [here](https://github.com/iCAPLyon1/WikiBundle/blob/master/Resources/views/Notification/notification_item.html.twig)
5. Create listener, for example [`NotificationListener`](https://github.com/iCAPLyon1/WikiBundle/blob/master/Listener/NotificationListener.php) and service e.g. [`listeners.yml`](https://github.com/iCAPLyon1/WikiBundle/blob/master/Resources/config/services/listeners.yml) is the example for WikiBundle
6. `*new`Create listener, [`NotificationUserParametersListener`](https://github.com/iCAPLyon1/WikiBundle/blob/master/Listener/NotificationUserParametersListener.php) to enable user activate and deactivate the display of your notifications

You can find a complete example of these steps in [iCAPLyon1/WikiBundle](https://github.com/iCAPLyon1/WikiBundle)

Please enable notification only for events that inform of content creation/addition. Not for content deletion. Otherwise a user will be lost in a "notification overload".

#### Integrate user tagging in plugins

[](#integrate-user-tagging-in-plugins)

If you want to allow users to tag and notify other users then you should follow these steps:

1. For every entity in your plugin that contains text, implemented by a tinymce editor (for example a post in a blog, a contribution in a wiki etc.) you need to create:

    - A protected variable to store the user picker object (contains the information about the original text, the final text, as long as the list of tagged users)

        ```
            protected $userPicker = null;

        ```
    - Develop a `@ORM\PrePersist` method that instanciates userPicker and swaps originalText with finalText.

        ```
        /**
        * @ORM\PrePersist
        */
         public function createUserPicker(LifecycleEventArgs $event){
             if ($this->getText() != null) {
                 $userPicker = new UserPickerContent($this->getText());
                 $this->setUserPicker($userPicker);
                 $this->setText($userPicker->getFinalText());
             }
         }

        ```
    - Create an entity listener class and associate it with your entity. Here is an example (for Contribution entity in WikiBundle):

        ```
            @ORM\EntityListeners({"Icap\WikiBundle\Listener\ContributionListener"})

        ```

        This entity Listener is responsible to create a notification and notify every tagged user on entity's postPersist event. [Here](https://github.com/iCAPLyon1/WikiBundle/blob/master/Listener/ContributionListener.php) is the example of the Contribution listener.
2. Add in `listeners.yml` file a line for the new event. Example:

    ```
        - { name: kernel.event_listener, event: create_notification_item_resource-icap_wiki-user_tagged, method: onCreateNotificationItem }

    ```
3. Handle the rendering of the new notification event. (Create dedicated view etc.) [Here](https://github.com/iCAPLyon1/WikiBundle/blob/master/Resources/views/Notification/notification_user_tagged.html.twig) is this view for the wiki bundle and [here](https://github.com/iCAPLyon1/WikiBundle/blob/master/Resources/views/Notification/notification_item.html.twig)is the modified notification\_item view to include the new event.

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community24

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor1

Top contributor holds 62.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~26 days

Recently: every ~68 days

Total

29

Last Release

3739d ago

Major Versions

v1.1.5 → v2.0.02014-12-04

v2.0.2 → v4.0.02015-03-13

v4.3.0 → 5.x-dev2015-05-22

v5.0.0 → v6.0.02015-08-24

PHP version history (2 changes)v1.0.0PHP &gt;=5.3.3

v1.0.7PHP &gt;=5.4.1

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2643253?v=4)[Vaince](/maintainers/Vaince)[@Vaince](https://github.com/Vaince)

---

Top Contributors

[![ptsavdar](https://avatars.githubusercontent.com/u/3414935?v=4)](https://github.com/ptsavdar "ptsavdar (60 commits)")[![maxailloud](https://avatars.githubusercontent.com/u/792787?v=4)](https://github.com/maxailloud "maxailloud (18 commits)")[![ngodfraind](https://avatars.githubusercontent.com/u/1397430?v=4)](https://github.com/ngodfraind "ngodfraind (14 commits)")[![smaurier](https://avatars.githubusercontent.com/u/12410624?v=4)](https://github.com/smaurier "smaurier (2 commits)")[![Vaince](https://avatars.githubusercontent.com/u/2643253?v=4)](https://github.com/Vaince "Vaince (2 commits)")

---

Tags

notificationICAPClaroline

### Embed Badge

![Health badge](/badges/icap-notification-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/icap-notification-bundle/health.svg)](https://phpackages.com/packages/icap-notification-bundle)
```

###  Alternatives

[symfony/notifier

Sends notifications via one or more channels (email, SMS, ...)

80640.3M290](/packages/symfony-notifier)[jolicode/jolinotif

Send desktop notifications on Windows, Linux, MacOS.

1.4k11.6M41](/packages/jolicode-jolinotif)[duccio/apns-php

Apple Push Notification &amp; Feedback Provider

1.4k2.5M13](/packages/duccio-apns-php)[laravel-notification-channels/telegram

Telegram Notifications Channel for Laravel

1.1k3.4M35](/packages/laravel-notification-channels-telegram)[mckenziearts/laravel-notify

Flexible flash notifications for Laravel

1.7k1.1M5](/packages/mckenziearts-laravel-notify)[laravel-notification-channels/twilio

Provides Twilio notification channel for Laravel

2587.7M12](/packages/laravel-notification-channels-twilio)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
