mirror of
https://github.com/vale981/Vulcan
synced 2025-03-06 10:01:40 -05:00
Use cursor to iterate lists of users
This commit is contained in:
parent
0bed5aa609
commit
8c655d55bf
1 changed files with 2 additions and 2 deletions
|
@ -53,11 +53,11 @@ Meteor.methods({
|
||||||
},
|
},
|
||||||
notifyUsers : function(notification, currentUser){
|
notifyUsers : function(notification, currentUser){
|
||||||
// send a notification to every user according to their notifications settings
|
// send a notification to every user according to their notifications settings
|
||||||
_.each(Meteor.users.find().fetch(), function(user, index, list){
|
Meteor.users.find().forEach(function(user) {
|
||||||
if(user._id !== currentUser._id && getUserSetting('notifications.posts', false, user)){
|
if(user._id !== currentUser._id && getUserSetting('notifications.posts', false, user)){
|
||||||
// don't send users notifications for their own posts
|
// don't send users notifications for their own posts
|
||||||
sendEmail(getEmail(user), notification.subject, notification.text, notification.html);
|
sendEmail(getEmail(user), notification.subject, notification.text, notification.html);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Reference in a new issue