-
Notifications
You must be signed in to change notification settings - Fork 12
Configuring Notification CRON Jobs
Notifications are primarily meant to be sent with CRON jobs. Notifications can be setup in a couple different ways to get the desired effect. The way you choose should be determined by what best suites your specific needs. Notifications can be sent all at once by a single request (for easy setup), or each notification can be managed by unique requests (for maximum performance on sites with high traffic).
Notifications will only be sent when their schedule determines it's the correct time. So if the schedule determines when a notification sent, it will not be sent unless it passes the validation no matter how many times a CRON job pings the url. Each schedule has it's own unique settings and can send requests at specific times and after a specified duration of time have passed. Other times you may want to send the notification anytime a request has been sent and want to rely on the CRON job itself for the scheduling. Either way is entirely possible with Postmaster.
Ping Url's
To attempt to send all notifications at once use the following url:
http://yoursite.com/postmaster/notifications/marshal
To attempt to send only a single notification use the following url:
http://yoursite.com/postmaster/notification/{{ id }}/marshal
Obviously replace {{ id }}
with the actual notification id you want to send.
Crontab
This section is meant to help you setup the crontabs on your server but assumes you have knowledge of setting up crontabs and command line access (if needed). If you want to only send a single replace, replace the url in the crontab with one you need to send. Since cron jobs are at the system level and systems vary dramatically, configuring cron jobs to your specific environment is outside the official support of Postmaster. This guide should help you get started.
Attempt to send all notifications every 5 minutes:
*/5 * * * * curl http://yoursite.com/postmaster/notifications/marshal
Attempt to send all notifications every hour:
0 * * * * curl http://yoursite.com/postmaster/notifications/marshal
attempt to send all notifications every day at noon:
0 12 * * * curl http://yoursite.com/postmaster/notifications/marshal
Attempt to send all notifications every Sunday at noon:
0 12 * * 0 curl http://yoursite.com/postmaster/notifications/marshal
Attempt to send all notifications on the 1st and 15th of every month at noon:
0 12 1,15 * * curl http://yoursite.com/postmaster/notifications/marshal