anklimsk / cakephp-notify
Sending E-mail using task queues and sending a notification to the user using WEB Notifications API from CakePHP 2.x
Installs: 32
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
Type:cakephp-plugin
Requires
- php: >=5.4
- anklimsk/cakephp-extended-test: ^1.0.0
- anklimsk/cakephp2-theme: ^1.0.0
- composer/installers: ^1.5.0
- dereuromark/cakephp-queue: ^2.3.0
- dereuromark/cakephp-tools: ^0.12.4
This package is auto-updated.
Last update: 2024-10-29 05:10:52 UTC
README
Sending E-mail from CakePHP using task queues and sending a notification to the user using WEB Notifications API
This plugin provides next features:
- Sending E-mail from CakePHP using task queues;
- Using Inline CSS style with
Twitter Bootstrap
; - Notification to the user by ID or role using WEB Notifications API.
Installation
-
Install the Plugin using composer:
composer require anklimsk/cakephp-notify
-
Add the next line to the end of the file
app/Config/bootstrap.php
:CakePlugin::load('CakeNotify', ['bootstrap' => true, 'routes' => true]);
-
Copy configuration file from
app/Plugin/CakeNotify/Config/email.php.defaultё to ёapp/Config/email.php
-
Add
JavaScript
files in your layout:echo $this->Html->script('CakeNotify.WebNotifications.min.js'); // Add jQuery plugin Server-Sent Events echo $this->Html->script('CakeNotify.jquery.sse.min.js'); // If need use store configuration of plugin in storages, include file: echo $this->Html->script('CakeNotify.js.storage.min.js');
-
Get the name of the user that is running the web server, run the command:
ps aux | grep -E '[a]pache|[h]ttpd|[_]www|[w]ww-data|[n]ginx' | grep -v root | head -1 | cut -d\ -f1
. -
Configure scripts to run schedule, run the command
crontab -u www-data -e
wherewww-data
- user name for web server. -
Add the following line to the list of cron jobs:
# # In this example, run the cleanup script expired notifications # will be made every day on 6:00 AM 0 6 * * * cd /var/www/paht_to_app/app && Console/cake CakeNotify.cron clear -q