title: Using the MeteorJS stack, how do I retrieve a user's email with their userId from a post they made
body: <p>MeteorJS newbie here. I have a collection of "posts" which has fields: title, createdAt, body, userId. Although I only have two users, there seems to be a different userId for each post. I basically just want to display the blog posts, along with their respective user's e-mails. My current implementation is as follows and it is displaying the email of the current user, not the owner of the blog post's email:</p>
  
  <pre><code>"click .main-feed-post" : function(event) {
  ...
  document.getElementById('post-view-email').innerHTML = Meteor.users.findOne({_id: this.userId}).emails[0].address;
  ...
  }
  </code></pre>
  
  <p>That is currently outputting only the logged-in user's email address. The previous is for the viewing individual blog posts. In addition, I have a main feed where I list all the blog posts and their respective owner's emails:</p>
  
  <pre><code>    {{#each posts}}
          &lt;li class="main-feed-post"&gt;
              {{title}}
              &lt;div class="main-feed-post-data"&gt;
              &lt;label&gt;BY&lt;/label&gt; {{getUserEmail}} &lt;label&gt;AT&lt;/label&gt;                                         {{formattedDate}}
      &lt;/div&gt;
     &lt;/li&gt;
  </code></pre>
  
  <p>...</p>
  
  <pre><code>getUserEmail : function() {
          return Meteor.users.findOne({_id: this.userId}).emails[0].address;
  
  }
     {{/each}}
  </code></pre>
  
  <p>This is outputting nothing, unless it is the current user's email. Ideally, I would add a username field to the user object and display that instead of the userId or email. I'm not sure how to implement this using the accounts-ui and accounts-password packages. Any help is welcome! Thanks in advance!</p>