Browse Source

unique recipient list

activeAddress
Ivan Socolsky 10 years ago
parent
commit
8151f68c3c
  1. 5
      lib/emailservice.js

5
lib/emailservice.js

@ -124,8 +124,11 @@ EmailService.prototype._getRecipientsList = function(notification, emailType, cb
if (err) return cb(err); if (err) return cb(err);
if (_.isEmpty(preferences)) return cb(null, []); if (_.isEmpty(preferences)) return cb(null, []);
var usedEmails = {};
var recipients = _.compact(_.map(preferences, function(p) { var recipients = _.compact(_.map(preferences, function(p) {
if (!p.email) return; if (!p.email || usedEmails[p.email]) return;
usedEmails[p.email] = true;
if (notification.creatorId == p.copayerId && !emailType.notifyDoer) return; if (notification.creatorId == p.copayerId && !emailType.notifyDoer) return;
return { return {
copayerId: p.copayerId, copayerId: p.copayerId,

Loading…
Cancel
Save