title: Using Python Variable in HTML / .format() for aws SES boto3
body: <p>I am trying to add a variable inside  html body but its not working.</p>
  <pre><code>import boto3
  SENDER = &quot;xyz@abc.com&quot;
  RECIPIENT = &quot;abc@abc.com&quot;
  AWS_REGION = &quot;yyy&quot;
  SUBJECT = &quot;Title&quot;
  BODY_HTML =
  &quot;&quot;&quot;
  
  &lt;!doctype html&gt; 
  ....
  #somecode
  &lt;td&gt;{email}&lt;/td&gt;
  &lt;/html&gt;
  BODY_HTML.replace(&quot;{&quot;, &quot;{{&quot;).replace(&quot;}&quot;, &quot;}}&quot;).format(email=&quot;ffdks@ncsdk&quot;)
  
  </code></pre>
  <p>The variable is sent in email as {email} instead of ffdks@ncsdk.</p>
  <p>And when replace is not there as:</p>
  <pre><code>BODY_HTML.format(email=&quot;ffdks@ncsdk&quot;)
  
  </code></pre>
  <p>It throws an error</p>
  <p>BODY_HTML.format(email=&quot;email&quot;)
  KeyError: '\n            font-family'</p>