-
Notifications
You must be signed in to change notification settings - Fork 618
Notifications
Guido Vilariño edited this page Aug 13, 2013
·
6 revisions
In branch: notifications
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.
In order to send notifications from anywhere in the app, you should first require the component and call it in the following fashion:
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();
notify('comment').to(users).at('00:42');
notify('comment').to(users).at('42 * * * *');
Visit our official website - Developed by Democracia en Red and contributors from the world over!