Pular para o conteúdo
Menu
Esta pergunta foi sinalizada
1094 Visualizações

Hi! I have a custom module in Odoo13 where I create a record and then, from the controller, I send a message to the user via message_post() method. Using this, I can see in the chatter a message and the user receives an email. This email has a header with the company logo and a link to the record. I didn't change any template or layout, this is normal behavior. But, if I go to the chatter and write the same message, in the chatter seems the same message but the user receives the email without that header with the logo and the link.

Is there any way to add this by default? I thought in some code which overwrites the default template with the mail.message_notification_email template, who has header and footer and seems is the one used when message_post() method. But I don't know which is the layout by default to overwrite.

I thought about something like that:

<template id="custom_mail_message_notification" inherit_id="mail.LAYOUT_BY_DEFAULT_IN_CHATTER">
    <xpath expr="//div[@class='email_template']" position="replace">
        <t t-call="mail.mail_notification_light">
            <t t-set="body">
                <div class="o_mail_message_body">
                    <t t-raw="message.body"/>
                </div>
            </t>
        </t>
    </xpath>
</template>

Anyone can help me? Thanks!

Avatar
Cancelar
Publicações relacionadas Respostas Visualizações Atividade
0
jan. 23
2295
1
mai. 22
4203
1
abr. 22
5368
0
set. 21
2208
0
jun. 21
2586