Public API for a society manager application

notification-controller.js 636B

12345678910111213141516
  1. module.exports = {
  2. send_notifications_for: function (event_id) {
  3. var event_controller = require("./event-controller.js");
  4. event_controller.get_event(event_id, "", function (response) {
  5. var attendees = response.event.attendees;
  6. console.log("Triggered Event: " + response.event.name);
  7. attendees.map(function (attendee) {
  8. console.log((new Date(Date.now())).toString() + " : Sending push notification to " + attendee + " for event starting at " + (new Date(Number(response.event.start)).toString()));
  9. });
  10. event_controller.cancel_event(event_id, "", function(){}, true);
  11. }, true);
  12. }
  13. }