title: How to integrate sendgrid templates with python app?`
body: <p>I want to integrate the template which I made on the Sendgrid Template Engine with my python application. I read the documentation and the source code on GitHub, but It give me error like this:</p>
  
  <p><code>HTTP 400; JSON in headers is valid but incompatible</code></p>
  
  <p>My source code is:</p>
  
  <pre><code>import sendgrid
  import json
  import os
  
  
  mail_to = raw_input("Reciever's Mail(Name &lt;email&gt;): ")
  subject = raw_input('Subject: ')
  mail_from = raw_input("Sender Mail(Name &lt;email&gt;): ")
  
  
  API_USER = os.getenv('API_USER')
  API_KEY = os.getenv('API_KEY')
  
  sg = sendgrid.SendGridClient(API_USER, API_KEY)
  
  plaintext = \
      """
          &lt;strong&gt;This mail is only for testing.&lt;/strong&gt;
      """
  htmlbody = \
      """
        Html Data
      """
  
  header_json = {
      'filters': {
          'templates': {
              'setting': {
                  'enabled': '1',
                  'template_id': '6967292-382-43aa-89dd-41fcd09b3fec'
              }
          }
      }
  }
  
  message = sendgrid.Mail(headers={'X-SMTPAPI': header_json})
  message.add_to(mail_to)
  message.set_subject(subject)
  message.set_html(htmlbody)
  message.set_text(plaintext)
  message.set_from(mail_from)
  
  status, msg = sg.send(message)
  
  print "HTTP STATUS", status
  
  msg = json.loads(msg)
  
  if status == 400:
      print msg
  </code></pre>
  
  <p>Can someone tell me how to integrate my template with my app?</p>