From fa44bdb4860bec31bb2d090c2e54c62cb551fcb7 Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Wed, 9 Jul 2014 16:42:22 +0200 Subject: [PATCH] [FIX] mass_mailing: load images in emails The emails containing emails generated with the image widget have absolute path (src='/website/static/...'), adding tag allows the mail client to load it correctly. --- addons/mass_mailing/models/mail_mail.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/addons/mass_mailing/models/mail_mail.py b/addons/mass_mailing/models/mail_mail.py index 0e44399a256..41be9c21cbf 100644 --- a/addons/mass_mailing/models/mail_mail.py +++ b/addons/mass_mailing/models/mail_mail.py @@ -74,6 +74,11 @@ class MailMail(osv.Model): """ Override to add the tracking URL to the body. """ body = super(MailMail, self).send_get_mail_body(cr, uid, mail, partner=partner, context=context) + # prepend tag for images using absolute urls + domain = self.pool.get("ir.config_parameter").get_param(cr, uid, "web.base.url", context=context) + base = "" % domain + body = tools.append_content_to_html(base, body, plaintext=False, container_tag='div') + # generate tracking URL if mail.statistics_ids: tracking_url = self._get_tracking_url(cr, uid, mail, partner, context=context)