PHPackages                             codekanzlei/cake-notifications - 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. codekanzlei/cake-notifications

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

codekanzlei/cake-notifications
==============================

CakePHP3 Notifications Plugin

v3.1.1(6y ago)842.8k↓39.2%61MITPHPPHP &gt;=7.1CI failing

Since Feb 11Pushed 6y ago4 watchersCompare

[ Source](https://github.com/scherersoftware/cake-notifications)[ Packagist](https://packagist.org/packages/codekanzlei/cake-notifications)[ Docs](https://github.com/scherersoftware/cake-notifications)[ RSS](/packages/codekanzlei-cake-notifications/feed)WikiDiscussions v2 Synced 1mo ago

READMEChangelog (10)Dependencies (4)Versions (62)Used By (1)

[![CakePHP 3 Notifications Plugin](https://raw.githubusercontent.com/scherersoftware/cake-notifications/v2/cake-notifications.png)](https://raw.githubusercontent.com/scherersoftware/cake-notifications/v2/cake-notifications.png)

[![Build Status](https://camo.githubusercontent.com/95d31171cbbf5ad7d942c0df51c981845ab2400550cc66a7a543dad895d97391/68747470733a2f2f7472617669732d63692e6f72672f73636865726572736f6674776172652f63616b652d6e6f74696669636174696f6e732e7376673f6272616e63683d76322d646576)](https://travis-ci.org/scherersoftware/cake-notifications)[![Code Coverage v2-dev](https://camo.githubusercontent.com/506ba85bcfb12c8e124c68887598c5982f903160ebaec7f55587fa8543883373/68747470733a2f2f636f6465636f762e696f2f67682f73636865726572736f6674776172652f63616b652d6e6f74696669636174696f6e732f6272616e63682f76322f67726170682f62616467652e737667)](https://codecov.io/gh/scherersoftware/cake-notifications)[![License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.txt)

A CakePHP 3.8 notification plugin which can send out emails asynchronously through to the cakephp-queuesadilla job queue.

Requirements
------------

[](#requirements)

- [CakePHP Queuesadilla Plugin 3.0](https://github.com/josegonzalez/cakephp-queuesadilla)
- PHP 7.1+

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

[](#installation)

### 1. Install the plugin via composer

[](#1-install-the-plugin-via-composer)

```
composer require codekanzlei/cake-notifications

```

### 2. Load the plugin in your `src/Application.php`

[](#2-load-the-plugin-in-your-srcapplicationphp)

```
$this->addPlugin('Notifications');

```

### 3. Configure `config/app.php`

[](#3-configure-configappphp)

Set your default locale in a config file, for example in `app.php`. This config is mandatory and will cause an exception if not set.

```
'Notifications' => [
    'defaultLocale' => 'en_US'
]

```

You can also override the queue options like `attempts`, `attempts_delay`, `delay`, `expires_in` and `queue`.

```
'Notifications' => [
    'queueOptions' => [
        'queue' => 'notification'
    ]
]

```

This doesn't affect the use of `queueOptions()` later. You can still override the options there.

Also, be sure to set up the the cakephp-queuesadilla plugin config. You can find an example config here: [https://cakephp-queuesadilla.readthedocs.io/en/latest/](https://github.com/josegonzalez/cakephp-queuesadilla).

Or you can find available config options inside your used Engine file (`vendor/josegonzalez/queuesadilla/src/josegonzalez/Queuesadilla/Engine/*Engine.php`) inside the `$baseConfig` property.

**IMPORTANT**: Set "date.timezone" in your cli/php.ini to an appropriate value, else notifications with a delay\_until could be sent out at the wrong time.

Usage
-----

[](#usage)

### Email

[](#email)

The EmailNotification is completely compatible with the CakePHP Email.

Add the following to your class where you want to send an email:

`use Notifications\Notification\EmailNotification;`

Then simply create a new EmailNotification object.

```
$email = new EmailNotification();
$email->to('john.doe@example.com')
    ->setSubject('Send with cake-notifications v2')
    ->send('Hello :)');

```

You can chain all methods provided by the CakePHP Email Class

### Additional, following functions are available:

[](#additional-following-functions-are-available)

### `send( array|string|null $content null )`

[](#send-arraystringnull-content-null-)

Send out the email immediately. before- and afterSend callbacks are still available

### `setLocale( string|null $locale null )`

[](#setlocale-stringnull-locale-null-)

Set the locale for the notification. If null, `Configure::read('Notifications.defaultLocale')` is used.

#### `push()`

[](#push)

Push the email into the queue to send it asynchronous

### `setQueueOptions( array $options null )`

[](#setqueueoptions-array-options-null-)

You can change some of the default options from the cakephp-queuesadilla plugin.

Supported options:

- `attempts` how often the notification will be executed again after a failure
- `attempts_delay` how long it takes in seconds until the notification will be executed again
- `delay` how long it takes until the notification will be executed for the first time in seconds
- `expires_in` how long the notification will stay in the queue in seconds
- `queue` name of the queue

### `setBeforeSendCallback( array|string|null $class null, array $args [] )`

[](#setbeforesendcallback-arraystringnull-class-null-array-args--)

Pass a callable as the `$class` parameter. Static and none-static functions are supported.

```
$email->beforeSendCallback(['Foo', 'bar'], ['first_param', 'second_param'])

```

This will call the `bar` method inside the Foo class with two parameters before the email is send.

To manipulate the EmailNotification instance before sending, the beforeSendCallback may return a function taking the notification instance reference and for example changing the profile. The `bar` method may then look something like this:

```
public function bar($first_param, $second_param)
{
    // do something
    return function (&$instance) {
        $instance->profile([
            'from' => 'email@example.com'
        ]);
    };
}

```

### `setAfterSendCallback( array|string|null $class null, array $args [] )`

[](#setaftersendcallback-arraystringnull-class-null-array-args--)

Pass a callable as the `$class` parameter. Static and none-static functions are supported.

```
$email-> afterSendCallback(['Foo::bar'], ['first_param', 'second_param'])

```

This will call the static `bar` method inside the Foo class with two parameters after the email was send.

### `addBeforeSendCallback( array|string|null $class null, array $args [] )`

[](#addbeforesendcallback-arraystringnull-class-null-array-args--)

Add an additional callback to beforeSend.

### `addAfterSendCallback( array|string|null $class null, array $args [] )`

[](#addaftersendcallback-arraystringnull-class-null-array-args--)

Add an additional callback to afterSend.

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity36

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity72

Established project with proven stability

 Bus Factor1

Top contributor holds 72.6% 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 ~30 days

Recently: every ~20 days

Total

60

Last Release

2307d ago

Major Versions

v1.1.32 → v2.02016-07-12

v1.1.33 → v2.0.52016-09-16

v2.2.1 → v3.0.02019-06-04

v3.1.0 → v4.0.0-rc12019-11-05

v2.x-dev → v4.0.0-rc22020-01-10

PHP version history (5 changes)v2.0PHP &gt;=5.4

v2.1PHP &gt;=5.6

v2.1.2PHP &gt;=7.0

v4.0.0-rc1PHP &gt;=7.1

v4.0.0-rc2PHP &gt;=7.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/7005ae518cf40495e5e8bbf91ae64379e5a853a62c2e35bcdc7ead11e6014ea2?d=identicon)[robertscherer](/maintainers/robertscherer)

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

---

Top Contributors

[![felixkempf](https://avatars.githubusercontent.com/u/8512231?v=4)](https://github.com/felixkempf "felixkempf (53 commits)")[![robertschererc](https://avatars.githubusercontent.com/u/203977391?v=4)](https://github.com/robertschererc "robertschererc (12 commits)")[![cleptric](https://avatars.githubusercontent.com/u/6617432?v=4)](https://github.com/cleptric "cleptric (8 commits)")

---

Tags

cakephp-plugincakephp3notificationsphp

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/codekanzlei-cake-notifications/health.svg)

```
[![Health](https://phpackages.com/badges/codekanzlei-cake-notifications/health.svg)](https://phpackages.com/packages/codekanzlei-cake-notifications)
```

###  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)
