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.

20 lines
636 B

  1. # Copyright 2016 Tecnativa - Antonio Espinosa
  2. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
  3. import json
  4. from odoo import models
  5. class IrMailServer(models.Model):
  6. _inherit = "ir.mail_server"
  7. def _tracking_headers_add(self, tracking_email_id, headers):
  8. headers = super(IrMailServer, self)._tracking_headers_add(
  9. tracking_email_id, headers)
  10. headers = headers or {}
  11. metadata = {
  12. 'odoo_db': self.env.cr.dbname,
  13. 'tracking_email_id': tracking_email_id,
  14. }
  15. headers['X-Mailgun-Variables'] = json.dumps(metadata)
  16. return headers