title: Easy way to convert HTML (WTForm) to static HTML email?
body: <p>I have a simple Flask/WTForm/Jinja2 pricing calculation app - consisting of simple form (table) of values (decimal, integer and pick values) and calc button, and a flash message for the calculated price. </p>
  
  <p>A requirement is to be able to email the form with entered values and calculated result out when user hits a send button. I'm looking for a quick and dirty way to do this.</p>
  
  <p>As I already generate the rendered form HTML (including price) to return from the POST route callback in Flask, I figured I could just grab this rendered output and email out as well when needed. So I have:</p>
  
  <pre><code>@app.route("/", methods=['GET', 'POST'])
  @auth.login_required
  def price_calc():
    form = PriceForm(request.form)
    calc_output = ""
  
    if request.method == 'POST':
      if form.validate():
        # Calc the price and show it 
        calc_output = ....
  
        # If user hit 'Send' submit button
        if request.form['submit'] == 'send':
          send_outputs = True
  
    # Generate the rendered form    
    render_result = render_template('app.html', calc_output = calc_output, form=form)
  
    if send_outputs:
      # TODO: Need to convert this to fixed 'snapshot' HTML for email use
      generate_email(user, render_result)
  
  
    return render_result
  </code></pre>
  
  <p>This works and the values etc all show up but the HTML email is (of course) a full 'active' copy of the form. By this I mean I can modify values, change drop downs etc when I receive the email. </p>
  
  <p>I'd like to convert this into a static snapshot (readonly) chunk of HTML with the values locked to state when captured. Is there any easy way to do this? I guess I could parse all the HTML elements and make them readonly somehow?</p>
  
  <p>Alternatively there might be a way to make HTML forms sent in emails fixed (readonly)?</p>
  
  <p>(I also need to strip some text and the submit buttons out but I'm guessing this will be trivial with some regex / Beautiful Soup parsing)</p>
  
  <p>Thanks!</p>