This question has been flagged

Hi

In Odoo 10, the default notification email template, is called "Notification Email", it has the xml ID "mail.mail_template_data_notification_email_default", and it's customisable in Settings/Email/Templates. It's written in Mako.

Good.

But for project.task related notifictions, I would like to use a whole new different template, rather than customise "Notification Email".

What should I override in Class project.task views or models to be able to specify another Email Template to use ?


I did find a very interesting piece of code in mail/models/res_partner.py :

       # existing custom notification email                                                                                     

base_template = None

        if message.model and self._context.get('custom_layout', False):

    base_template = self.env.ref(self._context['custom_layout'], raise_if_not_found=False)

        if not base_template:

            base_template = self.env.ref('mail.mail_template_data_notification_email_default')


base_template_ctx = self._notify_prepare_template_context(message)

        if not user_signature:

            base_template_ctx['signature'] = False

        base_mail_values = self._notify_prepare_email_values(message)

But I don't now where I should set this context inside project.task.

Somebody knows?


Avatar
Discard
Best Answer

Hello

Did you find a solution for this?

Thanks

René

Avatar
Discard