unique recipient list
This commit is contained in:
parent
0f0d2183a1
commit
8151f68c3c
|
@ -124,8 +124,11 @@ EmailService.prototype._getRecipientsList = function(notification, emailType, cb
|
|||
if (err) return cb(err);
|
||||
if (_.isEmpty(preferences)) return cb(null, []);
|
||||
|
||||
var usedEmails = {};
|
||||
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;
|
||||
return {
|
||||
copayerId: p.copayerId,
|
||||
|
|
Loading…
Reference in New Issue