You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

23 lines
791 B

# -*- coding: utf-8 -*-
# Copyright 2016 Tecnativa - Antonio Espinosa
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
import json
from openerp import models
class IrMailServer(models.Model):
_inherit = "ir.mail_server"
def _tracking_headers_add(self, tracking_email_id, headers):
headers = super(IrMailServer, self)._tracking_headers_add(
tracking_email_id, headers)
headers = headers or {}
metadata = {
# NOTE: We can not use 'self.env.cr.dbname' because self is
# ir.mail_server object in old API (osv.osv)
'odoo_db': self.pool.db_name,
'tracking_email_id': tracking_email_id,
}
headers['X-Mailgun-Variables'] = json.dumps(metadata)
return headers