|
|
@ -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, |
|
|
|