diff options
| author | std-odoo <std@odoo.com> | 2020-04-17 07:37:45 +0000 |
|---|---|---|
| committer | Debauche Stéphane <std@odoo.com> | 2020-06-12 11:49:45 +0000 |
| commit | b16843230d9c62606550c061934f319fee23d3c5 (patch) | |
| tree | 2b7608860889186fffa902ae2cf9cbb466d4281f /addons/mass_mailing_crm | |
| parent | 5227f956da1b64293f3e1301ff03b4efb28db80b (diff) | |
[IMP] mass_mailing: send a statistics email to the mailing responsible
Purpose
=======
Provide a follow-up/overview of the Mailing 24 hours after its been sent.
Specifications
==============
Send an email to the responsible of the mailing 24 hours the last email
of the mass mailing.
During the link trackers creation, extract the button label if exists
(so we can display them in the statistics email).
Technical remarks
=================
The statistics email is sent to the responsible of each mailing in the
CRON of mass mailing.
Task-2227411
closes odoo/odoo#49836
Related: odoo/upgrade#1094
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Diffstat (limited to 'addons/mass_mailing_crm')
| -rw-r--r-- | addons/mass_mailing_crm/models/mailing_mailing.py | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/addons/mass_mailing_crm/models/mailing_mailing.py b/addons/mass_mailing_crm/models/mailing_mailing.py index 97de181c798..19af7cff904 100644 --- a/addons/mass_mailing_crm/models/mailing_mailing.py +++ b/addons/mass_mailing_crm/models/mailing_mailing.py @@ -2,7 +2,7 @@ # Part of Odoo. See LICENSE file for full copyright and licensing details. -from odoo import api, fields, models +from odoo import api, fields, models, _, tools from odoo.osv import expression @@ -33,3 +33,14 @@ class MassMailing(models.Model): action['domain'] = [('source_id', 'in', self.source_id.ids)] action['context'] = {'active_test': False, 'create': False} return action + + def _prepare_statistics_email_values(self): + self.ensure_one() + values = super(MassMailing, self)._prepare_statistics_email_values() + if not self.user_id: + return values + values['kpi_data'][1]['kpi_col1'] = { + 'value': tools.format_decimalized_number(self.crm_lead_count, decimal=0), + 'col_subtitle': _('LEADS'), + } + return values |
