Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
1090 Vizualizări

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!

Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
0
ian. 23
2295
1
mai 22
4202
1
apr. 22
5363
0
sept. 21
2208
0
iun. 21
2586