'Override to add the tracking URL to the body and to add
Statistic_id in shorted urls'

@api.multi
def send_get_mail_body(self, partner=None):

    self.ensure_one()
    body = super(MailMail, self).send_get_mail_body(partner=partner)
    if (self.mailing_id and body and self.statistics_ids):
        for match in re.findall(URL_REGEX, self.body_html):
            href = match[0]
            url = match[1]
            parsed = urlparse.urlparse(url, scheme='http')
            if (parsed.scheme.startswith('http') and parsed.path.startswith('/r/')):
                new_href = href.replace(url, ((url + '/m/') + str(self.statistics_ids[0].id)))
                body = body.replace(href, new_href)
    domain = self.env['ir.config_parameter'].get_param('web.base.url')
    base = ("<base    href='%s'>" % domain)
    body = tools.append_content_to_html(base, body, plaintext=False, container_tag='div')
    def _sub_relative2absolute(match):
        return (match.group(1) + urlparse.urljoin(domain, match.group(2)))
    body = re.sub('(<img(?=\\s)[^>]*\\ssrc=")(/[^/][^"]+)', _sub_relative2absolute, body)
    body = re.sub('(<[^>]+\\bstyle="[^"]+\\burl\\(\\\'?)(/[^/\\\'][^\\\'")]+)', _sub_relative2absolute, body)
    if self.statistics_ids:
        tracking_url = self._get_tracking_url(partner)
        if tracking_url:
            body = tools.append_content_to_html(body, tracking_url, plaintext=False, container_tag='div')
    return body
