How can I see email addresses in Odoo marketing campaigns?

I sent several marketing campaigns on the Bulk Mailing page. I have an email button. When I click on it, I have the columns "Mail ID (tech)", "Message-ID", "Sent" and others. But I do not see the email address to which I sent.

How can I see the email, which, in my opinion, is the most important information, because I donโ€™t see which client opened the email?

+5
source share
1 answer

@Ek Kosmos, you need to add code for this. Please apply the following code to your repository.

addons / mass _mailing / models / mass_mailing_stats.py

def _compute_recipient(self, cr, uid, ids, field_names, arg, context=None): res = dict.fromkeys(ids, '') for stat in self.browse(cr, uid, ids, context=context): if not self.pool.get(stat.model): continue target = self.pool[stat.model].browse(cr, uid, stat.res_id, context=context) email = '' for email_field in ('email', 'email_from'): if email_field in target and target[email_field]: email = ' <%s>' % target[email_field] break res[stat.id] = '%s%s' % (target.display_name, email) return res 

in the same file add to columns = {}

 'recipient': fields.function(_compute_recipient, string='Recipient', type='char'), 

then add to the view

add-ons / mass_mailing / views / mass_mailing.xml

 <field name="recipient"/> 
+5
source

Source: https://habr.com/ru/post/1232177/


All Articles