title: New lines not persisting with AWS SES
body: <p>I'm trying to take data from <code>&lt;input&gt;</code>s and <code>&lt;textarea&gt;</code>s in a contact form, send them to my API, then place them into an AWS SES template in order to send these values as an email.</p>
  <p>For any <code>&lt;textarea&gt;</code>, when I do something like</p>
  <pre><code>TemplateData: JSON.stringify(formValues),
  </code></pre>
  <p>Given <code>formValues: FormValues</code> which has values directly from the HTML inputs</p>
  <pre><code>export type FormValues = {
    email: string,
    message: string,
  }
  </code></pre>
  <p>It results in an email being sent which strips all the new lines. It seemingly replaces them with <code>\\n</code> which don't have an effect on the final email.</p>
  <p>I think ideally I would do a <code>message.replaceAll(&quot;\n&quot;, &quot;\r\n&quot;)</code> for the <code>Text</code> email and <code>message.replaceAll(&quot;\n&quot;, &quot;&lt;br/&gt;&quot;)</code> for the <code>Html</code> email. This seems quite inconvenient though, especially as this format is stuck in the template which is defined like</p>
  <pre class="lang-json prettyprint-override"><code>{
    &quot;Template&quot;: {
      &quot;TemplateName&quot;: &quot;Contact&quot;,
      &quot;SubjectPart&quot;: &quot;Enquiry&quot;,
      &quot;HtmlPart&quot;: &quot;&lt;!DOCTYPE html&gt;&lt;html lang=\&quot;en-GB\&quot;&gt;&lt;body&gt;&lt;b&gt;Email:&lt;/b&gt; {{email}}&lt;br/&gt;&lt;br/&gt;&lt;b&gt;Message:&lt;/b&gt; {{message}}&lt;/body&gt;&lt;/html&gt;&quot;,
      &quot;TextPart&quot;: &quot;Email: {{email}}\r\nMessage: {{message}}&quot;
    }
  }
  </code></pre>
  <p>So, I don't see how it's possible to solve without using <code>&lt;br/</code> for <code>Html</code> emails and <code>\t\r\n</code> for <code>Text</code> emails, but I also can't think of a clean way of achieving that.</p>
  <p>Thanks.</p>
  <p>EDIT: I realised it could possibly have something to do with my sanitise function which looks like</p>
  <pre><code>function sanitiseFormValue(formValue: string): string {
    return formValue
    .replaceAll(&quot;&amp;&quot;, &quot;&amp;amp;&quot;)
    .replaceAll(&quot;&lt;&quot;, &quot;&amp;lt;&quot;)
    .replaceAll(&quot;&gt;&quot;, &quot;&amp;rt;&quot;)
    .replaceAll(&quot;\\&quot;, &quot;&amp;bsol;&quot;)
    .replaceAll(&quot;\&quot;&quot;, &quot;&amp;quot;&quot;)
    .replaceAll(&quot;'&quot;, &quot;&amp;apos;&quot;)
    .replaceAll(&quot;`&quot;, &quot;&amp;#96;&quot;)
  }
  </code></pre>
  <p>It is run before the <code>JSON.stringify</code>. However, I'm not sure how to get around this. And I would be surprised if this is interfering.</p>