title: extract text from html mail odoo
body: <p>I want to get the email body but not in html format . I have used Beautifulsoup and
      data = re.sub(r'&lt;.*?>', '', html2) 
  to remove the html tags but it didn't work I can't receieve email to applicant  </p>
  
  <pre><code>def message_new(self, cr, uid, msg, custom_values=None, context=None):
  """ Overrides mail_thread message_new that is called by the mailgateway
      through message_process.
      This override updates the document according to the email.
  """
  if custom_values is None:
      custom_values = {}
  val = msg.get('from').split('&lt;')[0]
  val1 = msg.get('from').split('&lt;')[1]
  val2 = val1.split('&gt;')[0]
  myString2 = msg.get('body') if msg.get('body') else ''
  soup = BeautifulSoup(myString2)
  data = soup.get_text()
  defaults = {
      'name': msg.get('subject') or _("No Subject"),
      'partner_name': val,
      'email_from': val2,
      'email_cc': msg.get('cc'),
      'user_id': False,
      'partner_id': msg.get('author_id', False),
      'description': data,
  }
  if msg.get('priority'):
      defaults['priority'] = msg.get('priority')
  defaults.update(custom_values)
  return super(hr_applicant, self).message_new(cr, uid, msg,custom_values=defaults, context=context)   
  </code></pre>