{"id":43666071,"url":"https://github.com/scherersoftware/cake-notifications","last_synced_at":"2026-02-04T22:45:26.487Z","repository":{"id":26522396,"uuid":"29975341","full_name":"scherersoftware/cake-notifications","owner":"scherersoftware","description":"CakePHP 3 Plugin for sending email and push notifications to users.","archived":false,"fork":false,"pushed_at":"2020-01-23T16:40:39.000Z","size":240,"stargazers_count":8,"open_issues_count":0,"forks_count":6,"subscribers_count":4,"default_branch":"v2","last_synced_at":"2026-01-14T18:24:54.692Z","etag":null,"topics":["cakephp-plugin","cakephp3","notifications","php"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/scherersoftware.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-01-28T15:59:31.000Z","updated_at":"2020-12-11T08:26:50.000Z","dependencies_parsed_at":"2022-08-30T00:02:20.741Z","dependency_job_id":null,"html_url":"https://github.com/scherersoftware/cake-notifications","commit_stats":null,"previous_names":["codekanzlei/cake-notifications"],"tags_count":58,"template":false,"template_full_name":null,"purl":"pkg:github/scherersoftware/cake-notifications","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scherersoftware%2Fcake-notifications","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scherersoftware%2Fcake-notifications/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scherersoftware%2Fcake-notifications/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scherersoftware%2Fcake-notifications/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/scherersoftware","download_url":"https://codeload.github.com/scherersoftware/cake-notifications/tar.gz/refs/heads/v2","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scherersoftware%2Fcake-notifications/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29098250,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-04T22:44:52.815Z","status":"ssl_error","status_checked_at":"2026-02-04T22:44:16.428Z","response_time":62,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cakephp-plugin","cakephp3","notifications","php"],"created_at":"2026-02-04T22:45:22.598Z","updated_at":"2026-02-04T22:45:26.480Z","avatar_url":"https://github.com/scherersoftware.png","language":"PHP","readme":"![CakePHP 3 Notifications Plugin](https://raw.githubusercontent.com/scherersoftware/cake-notifications/v2/cake-notifications.png)\n\n[![Build Status](https://travis-ci.org/scherersoftware/cake-notifications.svg?branch=v2-dev)](https://travis-ci.org/scherersoftware/cake-notifications)\n[![Code Coverage v2-dev](https://codecov.io/gh/scherersoftware/cake-notifications/branch/v2/graph/badge.svg)](https://codecov.io/gh/scherersoftware/cake-notifications)\n[![License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE.txt)\n\nA CakePHP 3.8 notification plugin which can send out emails asynchronously through to the cakephp-queuesadilla job queue.\n\n## Requirements\n\n- [CakePHP Queuesadilla Plugin 3.0](https://github.com/josegonzalez/cakephp-queuesadilla)\n- PHP 7.1+\n\n## Installation\n\n### 1. Install the plugin via composer\n\n    composer require codekanzlei/cake-notifications\n\n### 2. Load the plugin in your `src/Application.php`\n\n    $this-\u003eaddPlugin('Notifications');\n\n### 3. Configure `config/app.php`\n\nSet your default locale in a config file, for example in `app.php`.\nThis config is mandatory and will cause an exception if not set.\n\n```\n'Notifications' =\u003e [\n    'defaultLocale' =\u003e 'en_US'\n]\n```\n\nYou can also override the queue options like `attempts`, `attempts_delay`, `delay`, `expires_in` and `queue`.\n\n```\n'Notifications' =\u003e [\n    'queueOptions' =\u003e [\n        'queue' =\u003e 'notification'\n    ]\n]\n```\n\nThis doesn't affect the use of `queueOptions()` later. You can still override the options there.\n\nAlso, 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).\n\nOr you can find available config options inside your used Engine file (`vendor/josegonzalez/queuesadilla/src/josegonzalez/Queuesadilla/Engine/*Engine.php`) inside the `$baseConfig` property.\n\n\n**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.\n\n## Usage\n\n### Email\n\nThe EmailNotification is completely compatible with the CakePHP Email.\n\nAdd the following to your class where you want to send an email:\n\n`use Notifications\\Notification\\EmailNotification;`\n\nThen simply create a new EmailNotification object.\n\n```\n$email = new EmailNotification();\n$email-\u003eto('john.doe@example.com')\n    -\u003esetSubject('Send with cake-notifications v2')\n    -\u003esend('Hello :)');\n\n```\n\nYou can chain all methods provided by the CakePHP Email Class [http://book.cakephp.org/3.0/en/core-libraries/email.html](http://book.cakephp.org/3.0/en/core-libraries/email.html)\n\n### Additional, following functions are available:\n\n### ` send( array|string|null $content null ) `\n\nSend out the email immediately. before- and afterSend callbacks are still available\n\n### ` setLocale( string|null $locale null ) `\n\nSet the locale for the notification. If null, ```Configure::read('Notifications.defaultLocale')``` is used.\n\n#### ` push() `\n\nPush the email into the queue to send it asynchronous\n\n### ` setQueueOptions( array $options null ) `\n\nYou can change some of the default options from the cakephp-queuesadilla plugin.\n\nSupported options:\n\n- `attempts` how often the notification will be executed again after a failure\n- `attempts_delay` how long it takes in seconds until the notification will be executed again\n- `delay` how long it takes until the notification will be executed for the first time  in seconds\n- `expires_in` how long the notification will stay in the queue in seconds\n- `queue` name of the queue\n\n### `setBeforeSendCallback( array|string|null $class null, array $args [] )`\n\nPass a callable as the `$class` parameter. Static and none-static functions are supported.\n\n```\n$email-\u003ebeforeSendCallback(['Foo', 'bar'], ['first_param', 'second_param'])\n\n```     \nThis will call the `bar` method inside the Foo class with two parameters before the email is send.\n\nTo manipulate the EmailNotification instance before sending, the beforeSendCallback may return a function taking the notification instance reference and for example changing the profile.\nThe `bar` method may then look something like this:\n\n```\npublic function bar($first_param, $second_param)\n{\n    // do something\n    return function (\u0026$instance) {\n        $instance-\u003eprofile([\n            'from' =\u003e 'email@example.com'\n        ]);\n    };\n}\n```\n\n### `setAfterSendCallback( array|string|null $class null, array $args [] )`\n\nPass a callable as the `$class` parameter. Static and none-static functions are supported.\n\n```\n$email-\u003e afterSendCallback(['Foo::bar'], ['first_param', 'second_param'])\n```     \nThis will call the static `bar` method inside the Foo class with two parameters after the email was send.\n\n### `addBeforeSendCallback( array|string|null $class null, array $args [] )`\n\nAdd an additional callback to beforeSend.\n\n### `addAfterSendCallback( array|string|null $class null, array $args [] )`\n\nAdd an additional callback to afterSend.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscherersoftware%2Fcake-notifications","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscherersoftware%2Fcake-notifications","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscherersoftware%2Fcake-notifications/lists"}