Skip to content

Instantly share code, notes, and snippets.

@Rebolon
Created September 8, 2015 13:30
Show Gist options
  • Save Rebolon/ace398525d2ee2668bcd to your computer and use it in GitHub Desktop.
Save Rebolon/ace398525d2ee2668bcd to your computer and use it in GitHub Desktop.
get one email from MeteorJs user profile
// it will retreive all verified address and return the first one
// if none found, it will juste return the first address
var email = _.chain(Meteor.user().emails).each(function(email) {
if (email.verified === true) {
return email;
}
}).value() || _.first(Meteor.user().emails);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment