Fork us on GitHub


Notifications can be sent whenever a job enters a specific state. By default, the Scheduler sends out notifications when a job enters the Success or Failed state. It is however relatively easy to add notification hooks to the other states as well.

Adding notifications to a job

Via the web front end

Adding notifications via the web front end can be done by entering email addresses and web urls in the Notify field: Entering notifications in the web front end

Via the API

To add notifications via the API with the codem executable, use the following:

$ codem -i /files/movie.flv -o /files/movie.mp4 -p h264 -n,

Receiving notifications

If an email notification is sent, the specified email address received a plain text email describing the changes that happened. The email includes a direct link to the job in the Scheduler API. If an url notification is sent, the corresponding url receives a JSON representation of the job. The JSON below is an example when a job entered the Success state.

	"job": {

Adding notifications to other states

Adding notifications to other states is very easy. Open app/models/jobs/states.rb in a text editor, and add notify to the state you want to be notified of. In the screenshot below, sending notifications have been added to the OnHold state. Send notifications when a job enters OnHold

Adding custom notifiers

To add a custom notification to the scheduler, subclass Notification and implement the do_notify! method. This method will receive a hash of options, namely: { :job => Job object, :state => 'state name' }. For instance, to create a notifier that sends information to Twitter using the twitter gem: Example Twitter notifier To actually expose the custom notifier into the Scheduler, add it to the from_api method of Notifier.
This implementation is left as an exercise to the reader.