title: Passing variables to html from Python
body: <p>I have a function which sends a mail to a user, like this:</p>
  <pre><code>import os
  import smtplib
  import imghdr
  from email.message import EmailMessage
  
  EMAIL_ADDRESS = email
  EMAIL_PASSWORD = password
  
  
  msg = EmailMessage()
  msg['Subject'] = 'Email Title'
  msg['From'] = EMAIL_ADDRESS
  msg['To'] = ANOTHER_EMAIL_ADDRESS
  
  msg.set_content('Email content')
  html = open('email.html', 'r').read()
  print(html)
  msg.add_alternative(html, subtype='html')
  
  
  with smtplib.SMTP_SSL('smtp.gmail.com', 465) as smtp:
      smtp.login(EMAIL_ADDRESS, EMAIL_PASSWORD)
      smtp.send_message(msg)
  </code></pre>
  <p>And the html file is like the following:</p>
  <pre><code>&lt;!DOCTYPE html&gt;
  
  &lt;body&gt;
      &lt;h3 style=&quot;font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;font-size: large;font-weight: bold;&quot;&gt;Hey there, {{userEmail}}!
          &lt;h3&gt;
  
  
  &lt;/body&gt;
  
  &lt;/html&gt;
  </code></pre>
  <p>I want to be able to pass the 'userEmail' variable to the HTML file.
  How may I do that?</p>