function SubscribedCategoriesNotifications (post) {

  if (Meteor.isServer && !!post.categories && !!post.categories.length) {
    // get the subscribers of the different categories from the post's categories
    const subscribers = post.categories
                              // find the category from its id
                              .map(categoryId => Categories.findOne({_id: categoryId}))
                              // clean the array if none subscribe to this category
                              .filter(category => typeof category.subscribers !== 'undefined' || !!category.subscribers)
                              // build the subscribers list interested in these categories
                              .reduce((subscribersList, category) => [...subscribersList, ...category.subscribers], []);

    let userIdsNotified = [];
    const notificationData = {
      post: _.pick(post, '_id', 'userId', 'title', 'url', 'author')
    };

    if (!!subscribers && !!subscribers.length) {
      // remove userIds of users that have already been notified and of post's author 
      let subscriberIdsToNotify = _.uniq(_.difference(subscribers, userIdsNotified, [post.userId]));
      
      createNotification(subscriberIdsToNotify, 'newPost', notificationData);

      userIdsNotified = userIdsNotified.concat(subscriberIdsToNotify);
    }
  }
}
@summary Notify users subscribed to 'another user' whenever another user posts