2017-10-17 20:38:11 +02:00
|
|
|
# Copyright 2016 Tecnativa - Antonio Espinosa
|
2016-07-15 13:41:49 +02:00
|
|
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
|
|
|
|
|
|
|
import json
|
2020-04-02 11:15:00 +02:00
|
|
|
|
2016-10-14 22:57:30 +02:00
|
|
|
from odoo import models
|
2016-07-15 13:41:49 +02:00
|
|
|
|
|
|
|
|
|
|
|
class IrMailServer(models.Model):
|
|
|
|
_inherit = "ir.mail_server"
|
|
|
|
|
|
|
|
def _tracking_headers_add(self, tracking_email_id, headers):
|
2021-07-22 10:24:42 +02:00
|
|
|
headers = super()._tracking_headers_add(tracking_email_id, headers)
|
2016-07-15 13:41:49 +02:00
|
|
|
headers = headers or {}
|
|
|
|
metadata = {
|
2020-04-02 11:15:00 +02:00
|
|
|
"odoo_db": self.env.cr.dbname,
|
|
|
|
"tracking_email_id": tracking_email_id,
|
2016-07-15 13:41:49 +02:00
|
|
|
}
|
2020-04-02 11:15:00 +02:00
|
|
|
headers["X-Mailgun-Variables"] = json.dumps(metadata)
|
2016-07-15 13:41:49 +02:00
|
|
|
return headers
|