Created
September 8, 2015 13:30
-
-
Save Rebolon/ace398525d2ee2668bcd to your computer and use it in GitHub Desktop.
get one email from MeteorJs user profile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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