Merge pull request #1466 from chptung/patch-2

Update subscriberIdsToNotify to send unique emails
This commit is contained in:
Xavier Cazalot 2016-10-07 18:19:17 +02:00 committed by GitHub
commit a9ece97650

View file

@ -90,7 +90,7 @@ if (typeof Package['nova:posts'] !== "undefined") {
if (!!subscribers && !!subscribers.length) {
// remove userIds of users that have already been notified and of post's author
let subscriberIdsToNotify = _.difference(subscribers, userIdsNotified, [post.userId]);
let subscriberIdsToNotify = _.uniq(_.difference(subscribers, userIdsNotified, [post.userId]));
Telescope.notifications.create(subscriberIdsToNotify, 'newPost', notificationData);