PHPackages                             oxenti/cakephp-notifier - 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. oxenti/cakephp-notifier

ActiveCakephp-plugin[Mail &amp; Notifications](/categories/mail)

oxenti/cakephp-notifier
=======================

Oxenti fork from cakemanager Notifier plugin for CakePHP

1.0.0(10y ago)072PHPPHP &gt;=5.4.16

Since Sep 26Pushed 9y ago4 watchersCompare

[ Source](https://github.com/oxenti/cakephp-notifier)[ Packagist](https://packagist.org/packages/oxenti/cakephp-notifier)[ RSS](/packages/oxenti-cakephp-notifier/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (3)Versions (3)Used By (0)

Notifier plugin for CakePHP
===========================

[](#notifier-plugin-for-cakephp)

[![Build Status](https://camo.githubusercontent.com/607bc1e9565192f62c07e9797d57d63807529a9ce6220ea0a8066696b1dd3430/68747470733a2f2f7472617669732d63692e6f72672f63616b656d616e616765722f63616b657068702d6e6f7469666965722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/cakemanager/cakephp-notifier)[![Coverage Status](https://camo.githubusercontent.com/4cf7faacfb322034d60e35f7322b74300294c8e95da41cd4fe40dded7e9634bb/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f63616b656d616e616765722f63616b657068702d6e6f7469666965722f62616467652e7376673f6272616e63683d6d617374657226736572766963653d676974687562)](https://coveralls.io/github/cakemanager/cakephp-notifier?branch=master)[![Gitter](https://camo.githubusercontent.com/abe08b740a4156153736f791393ec4da6619c4be73212e75769f52edacc0e2b5/68747470733a2f2f6261646765732e6769747465722e696d2f4a6f696e253230436861742e737667)](https://gitter.im/cakemanager/cakephp-notifier?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)

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

[](#installation)

You can install this plugin into your CakePHP application using [composer](http://getcomposer.org).

The recommended way to install composer packages is:

```
    composer require oxenti/cakephp-notifier:dev-master

```

Usage
-----

[](#usage)

### Configurations

[](#configurations)

You will need to add the following line to your application's bootstrap.php file:

```
Plugin::load('Notifier', ['bootstrap' => true, 'routes' => true]);

// or run the following command:
bin/cake plugin install -b -r Notifier

```

Note: You don't need to load the routes if you are not using the CakeManager Plugin.

After loading the plugin you need to migrate the tables for the plugin using:

```
bin/cake migrations migrate -p Notifier

```

### NotificationManager

[](#notificationmanager)

The `NotificationManager` is the Manager of the plugin. You can get an instance with:

```
NotificationManager::instance();

```

The `NotificationManager` has the following namespace: `Notifier\Utility\NotificationManager`.

### NotifierComponent

[](#notifiercomponent)

The `NotifierComponent can be used in controllers to create notifications and return data like read/unread notifications and totals (like 4 unread notifications).

### Templates

[](#templates)

Notifications are viewed in a template including variables. When sending a new notification, you tell the notification what template to use.

An example about how to add templates:

```
$notificationManager->addTemplate('newBlog', [
    'title' => 'New blog by :username',
    'body' => ':username has posted a new blog named :name'
]);

```

When adding a new template, you have to add a `title` and a `body`. Both are able to contain variables like `:username`and `:name`. Later on we will tell more about these variables.

Removing a template is easy:

```
$notificationManager->removeTemplate('newBlog');

```

### Notify

[](#notify)

Now we will be able to send a new notification using our `newBlog` template.

```
$notificationManager->notify([
    'users' => [1,2],
    'recipientLists' => ['administrators'],
    'template' => 'newBlog',
    'vars' => [
        'username' => 'Bob Mulder',
        'name' => 'My great new blogpost'
    ]
]);

```

> Note: You are also able to send notifications via the component: `$this->Notifier->notify()`.

With the `notify` method we sent a new notification. A list of all attributes:

- `users` - This is an integer or array filled with id's of users to notify. So, when you want to notify user 261 and 373, add `[261, 373]`.
- `recipientLists` - This is a string or array with lists of recipients. Further on you can find more about RecipientLists.
- `template` - The template you added, for example `newBlog`.
- `vars` - Variables to use. In the template `newBlog` we used the variables `username` and `name`. These variables can be defined here.

### Lists

[](#lists)

Of course you want to get a list of notifications per user. Here are some examples:

```
// getting a list of all notifications of the current logged in user
$this->Notifier->getNotifications();

// getting a list of all notifications of the user with id 2
$this->Notifier->getNotifications(2);

// getting a list of all unread notifications
$this->Notifier->allNotificationList(2, true);

// getting a list of all read notifications
$this->Notifier->allNotificationList(2, false);

// getting a number of all notifications of the current logged in user
$this->Notifier->countNotifications();

// getting a number of all notifications of the user with id 2
$this->Notifier->countNotifications(2);

// getting a number of all unread notifications
$this->Notifier->countNotificationList(2, true);

// getting a number of all read notifications
$this->Notifier->countNotificationList(2, false);

```

You can do something like this to use the notification-list in your view:

```
$this->set('notifications', $this->Notifier->getNotifications());

```

### RecipientLists

[](#recipientlists)

To send notifications to large groups you are able to use RecipientLists. You can register them with:

```
$notificationManager->addRecipientList('administrators', [1,2,3,4]);

```

Now we have created a list of recipients called `administrators`.

This can be used later on when we send a new notification:

```
$notificationManager->notify([
    'recipientLists' => ['administrators'],
]);

```

Now, the users 1, 2, 3 and 4 will recieve a notification.

### Model / Entity

[](#model--entity)

The following getters can be used at your entity:

- `title` - The generated title including the variables.
- `body` - The generated body including the variables.
- `unread` - Boolean if the notification is not read yet.
- `read` - Boolean if the notification is read yet.

Example:

```
// returns true or false
$entity->get('unread');

// returns the full output 'Bob Mulder has posted a new blog named My Great New Post'
$entity->get('body');

```

Keep in touch
-------------

[](#keep-in-touch)

If you need some help or got ideas for this plugin, feel free to chat at [Gitter](https://gitter.im/cakemanager/cakephp-notifier).

Pull Requests are always more than welcome!

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 75% 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

Unknown

Total

1

Last Release

3882d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/c0458b3f935490a30fbe0ad70692fb5bee88e0c191e1cce409a1cb7678ad4e19?d=identicon)[oxenti](/maintainers/oxenti)

---

Top Contributors

[![bobmulder](https://avatars.githubusercontent.com/u/5465074?v=4)](https://github.com/bobmulder "bobmulder (21 commits)")[![GenesioValois](https://avatars.githubusercontent.com/u/406555?v=4)](https://github.com/GenesioValois "GenesioValois (3 commits)")[![leoruhland](https://avatars.githubusercontent.com/u/1785552?v=4)](https://github.com/leoruhland "leoruhland (2 commits)")[![adewaleandrade](https://avatars.githubusercontent.com/u/155085?v=4)](https://github.com/adewaleandrade "adewaleandrade (1 commits)")[![jpkleemans](https://avatars.githubusercontent.com/u/5700014?v=4)](https://github.com/jpkleemans "jpkleemans (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/oxenti-cakephp-notifier/health.svg)

```
[![Health](https://phpackages.com/badges/oxenti-cakephp-notifier/health.svg)](https://phpackages.com/packages/oxenti-cakephp-notifier)
```

###  Alternatives

[lorenzo/cakephp-email-queue

Queue, preview and and send emails stored in the database

57121.5k1](/packages/lorenzo-cakephp-email-queue)[narendravaghela/cakephp-mailgun

Mailgun plugin for CakePHP - Send emails using Mailgun API

23356.6k](/packages/narendravaghela-cakephp-mailgun)[iandenh/cakephp-sendgrid

SendgridEmail plugin for CakePHP

16123.4k](/packages/iandenh-cakephp-sendgrid)[gourmet/email

Gourmet Email Plugin for rapid CakePHP application development.

175.2k](/packages/gourmet-email)

PHPackages © 2026

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