title: Add external email for google apps user
body: <p>I've tried this code in a Google Spreadsheet Script to add another (external) email for my Google Apps Domain users:</p>
  
  <pre class="lang-js prettyprint-override"><code>function createExternalEmail() {
    var userId = "sampleuser@mydomain.org";
    var update = {
      emails:
      {
        address: "sampleuser@homeemail.com",
        type: "home",
        customType: "",
        primary: false
      }, 
      addresses:
      {
        type: "home",
        customType: "",
        streetAddress: "1600 Amphitheatre Parkway",
        locality: "Mountain View",
        region: "CA",
        postalCode: "94043"
   }
    }
      update = AdminDirectory.Users.update(update, userId);
      var user = AdminDirectory.Users.get(userId);
      Logger.log('User emails:\n %s', JSON.stringify(user.emails, null, 2));
      Logger.log('User addresses:\n %s', JSON.stringify(user.addresses, null, 2));
  }
  </code></pre>
  
  <p>But the updated values are not returned in the Logger.log. What's missing?</p>