Sending E-mail from CakePHP using task queues and sending a notification to the user using WEB Notifications API
Sending E-mail from CakePHP using task queues and sending a notification to the user using WEB Notifications API
Twitter Bootstrap
;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]);
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');
ps aux | grep -E '[a]pache|[h]ttpd|[_]www|[w]ww-data|[n]ginx' | grep -v root | head -1 | cut -d\ -f1
.crontab -u www-data -e
where
www-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