Skip to content
Guido Vilariño edited this page Aug 13, 2013 · 6 revisions

In branch: notifications

Features

Templates are made in Jade and you can pass variables to them, so it's super flexible about what you can put into them.

For each kind of notification desired, there should be a NotificationProvider (currently there's only one, for email). The idea is to be able to notify by email, in-app, facebook, socket.io or whatever it is, through the same system.

Supports instantaneous and scheduled notifications.

To add events you just need to update notifications.json and create a view for them.

Usage

In order to send notifications from anywhere in the app, you should first require the component and call it in the following fashion:

Instantaneous notifications

notify('comment').to(users).withData({ proposal_id: 1234 }).now();
notify('proposal').to(proposal.author).by('email').now();
notify('tag').to(users).by(['email', 'facebook']).now();

Sheduled notifications

notify('comment').to(users).at('00:42');
notify('comment').to(users).at('42 * * * *');
Clone this wiki locally