[FIX] mass_mailing: fixed issue when generating unsubscirbe urlé

bzr revid: tde@openerp.com-20140415160743-5i0pjieo4o031ico
This commit is contained in:
Thibault Delavallée 2014-04-15 18:07:43 +02:00
parent f7d7e34467
commit c5627c4d3f
1 changed files with 2 additions and 2 deletions

View File

@ -83,8 +83,8 @@ class MailMail(osv.Model):
def send_get_email_dict(self, cr, uid, mail, partner=None, context=None):
res = super(MailMail, self).send_get_email_dict(cr, uid, mail, partner, context=context)
if mail.mailing_id and res.get('body'):
email_to = tools.email_split(res.get('email_to'))
if mail.mailing_id and res.get('body') and res.get('email_to'):
email_to = tools.email_split(res.get('email_to')[0])
unsubscribe_url = self._get_unsubscribe_url(cr, uid, mail, email_to, context=context)
if unsubscribe_url:
res['body'] = tools.append_content_to_html(res['body'], unsubscribe_url, plaintext=False, container_tag='p')