title: Basic JSON formatting using Mule Expression Language
body: <p>When sending POST requests to an address on Slack, the JSON needs to be formatted as such:</p>
  
  <pre><code>{"channel": "#testing", "username": "test", "text": "Subject"}
  </code></pre>
  
  <p>Or something of the sort, which is normal. The problem I'm having is really basic, but basically, I need to send some details that are obtained from an email via JSON, something like this:</p>
  
  <pre><code>{"channel": "#testing", "username": "#[message.inboundProperties['From']]", "text": "Subject"}
  </code></pre>
  
  <p>And when I log the payload after this, I get:</p>
  
  <pre><code>{"channel": "#testing", "username": ""Doe, John" &lt;email@address.com&gt;", "text": "Subject"}
  </code></pre>
  
  <p>And this throws a 500 error code, presumably because it is no longer valid JSON (my guess would be because of the weird quotations, but then if I do something else and do something like this:</p>
  
  <pre><code>{"channel": "#testing", "username": "username", "text": "#[message.payload]"}
  </code></pre>
  
  <p>Gives me this:</p>
  
  <pre><code>{"channel": "#testing", "username": "username", "text": "email body
  ", "icon_emoji": ":man_with_turban:"}
  </code></pre>
  
  <p>Which looks valid to me, but does not work (perhaps there's a new line character or something, but even then it's just a character in a string is it not?)</p>
  
  <p>I'm not sure how I could do this properly.</p>