title: Outlook add-in: Is there a way to get the text from email compose with new lines?
body: <p>I'm having an issue that I'm not so sure how to overcome it.</p>
  
  <p>I'm able to get the message compose text, but I need to get new lines as well (ENTER clicked).</p>
  
  <p>so if the message is:</p>
  
  <pre><code>"This is an example
  for new line"
  </code></pre>
  
  <p>I will get in the <code>body.getAsync</code>
  This is an example <code>\n</code> for new line</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>    Office.initialize = function (reason) {
        mailboxItem = Office.context.mailbox.item;
      }
        
      function validateBody(event) {
        mailboxItem.body.getAsync("text", { asyncContext: event }, sendToServer);
      }
      
      function sendToServer(asyncResult){
        //NOW HERE I NEED THE TEXT WITH NEW LINES
        //(like:This is an example \n for new line)
      }</code></pre>
  </div>
  </div>
  </p>
  
  <p>If the is no way to do this, then is there a way to get the item body as plain javascript object?
   and add to it:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>item.addEventListener("keyup", function(event) {
    // Number 13 is the "Enter" key on the keyboard
    if (event.keyCode === 13) {
      // DO THIS
    }
  });</code></pre>
  </div>
  </div>
  </p>