OCA / social

Addons concerning odoo's social ERP features and messaging in general
https://odoo-community.org/project/99
GNU Affero General Public License v3.0
160 stars 615 forks source link

[14.0] mail_debrand empty content for sign up #884

Closed remi-filament closed 2 years ago

remi-filament commented 2 years ago

Using mail_debrand, the content of the mail sent at sign up is empty (headers and footer are properly filled) :

    <!-- CONTENT -->
    <tr>
        <td align="center" style="min-width: 590px;">
            <table border="0" cellpadding="0" cellspacing="0" width="590" style="min-width: 590px; background-color: white; padding: 0px 8px 0px 8px; border-collapse:separate;">
                <tr><td valign="top" style="font-size: 13px;">
                    </td></tr>
                <tr><td style="text-align:center;">
                  <hr width="100%" style="background-color:rgb(204,204,204);border:medium none;clear:both;display:block;font-size:0px;min-height:1px;line-height:0; margin: 16px 0px 16px 0px;">
                </td></tr>
            </table>
        </td>
    </tr>

Without mail_debrand module installed I get the following content :

    <!-- CONTENT -->
    <tr>
        <td align="center" style="min-width: 590px;">
            <table border="0" cellpadding="0" cellspacing="0" width="590" style="min-width: 590px; background-color: white; padding: 0px 8px 0px 8px; border-collapse:separate;">
                <tr><td valign="top" style="font-size: 13px;">
                    <div>
                        Cher(e) test,<br/><br/>
                        Vous avez été invité par Admin LE FILAMENT à rejoindre Odoo.
                        <div style="margin: 16px 0px 16px 0px;">
                            <a href="removed_url" style="background-color: #875A7B; padding: 8px 16px 8px 16px; text-decoration: none; color: #fff; border-radius: 5px; font-size:13px;">
                                Accepter l'invitation
                            </a>
                        </div>
                        Votre nom de domaine Odoo est: <b><a href="removed_url">removed_url</a></b><br/>
                        Votre courriel de connection est: <b><a href="removed_url" target="_blank">removed_email</a></b><br/><br/>
                        Jamais entendu parler d'Odoo? C’est un logiciel de gestion tout-en-un apprécié par plus de 3 millions d’utilisateurs. Il améliorera considérablement votre expérience de travail et augmentera votre productivité.
                        <br/><br/>
                        Faites un tour dans la section <a href="https://www.odoo.com/page/tour?utm_source=db&amp;utm_medium=auth" style="color: #875A7B;">Odoo Tour</a> afin de découvrir l'outil.
                        <br/><br/>
                        Enjoy Odoo!<br/>
                        --<br/>L'équipe LE FILAMENT 
                    </div>
                </td></tr>
                <tr><td style="text-align:center;">
                  <hr width="100%" style="background-color:rgb(204,204,204);border:medium none;clear:both;display:block;font-size:0px;min-height:1px;line-height:0; margin: 16px 0px 16px 0px;"/>
                </td></tr>
            </table>
        </td>
    </tr>

The issue seems related to this block : https://github.com/OCA/social/blob/02467d14fa4b2ade959ced981f3a0411d46e1d26/mail_debrand/models/mail_render_mixin.py#L51-L52 where the full div is removed because of Odoo tour section.

I am not sure how to address this without breaking the way this module works for other mail templates, any idea would be welcome !

remi-filament commented 2 years ago

Workaround is to update e-mail template auth_signup.set_password_email to remove the following lines : https://github.com/odoo/odoo/blob/5bd8596410f8584ce430567ebfec0a42fb40f755/addons/auth_signup/data/auth_signup_data.xml#L152-L153

rafaelbn commented 2 years ago

Hello @remi-filament 😄 !!! Do you want to review this PR? https://github.com/OCA/social/pull/911

It doesn't solve your issue, but is the first step.

@moduon MT-787

francesco-ooops commented 2 years ago

@Shide did you find any hint on how to fix this issue?

rafaelbn commented 2 years ago

This issue is trying to be fixed recreating the template in https://github.com/OCA/social/pull/937