[IMP] website_profile: set correct 'email_from' in validation email

Currently, the 'email_from' field of the 'validation_email' mail template
is utilizing logged in user's email address. However, in our case, logged
in user is the same as one to which we are sending verification email.
This creates the impression that you are sending the mail to yourself,
which is not correct.

With this commit, we now utilize the receiver's company email address
'email_formatted'. This compute field will first prioritize company's
partner email address, and if not available, it will fallback to the
catchall address of the company. If both are not available, we simply
use logged in user's email as before.

TaskID-2634155

closes odoo/odoo#76380

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
This commit is contained in:
ijas ahammed
2021-09-15 12:42:03 +00:00
parent a53e80e021
commit 3fad70bdc5
@@ -7,7 +7,7 @@
<field name="name">Profile: Email Verification</field>
<field name="model_id" ref="base.model_res_users"/>
<field name="subject">${object.company_id.name} Profile validation</field>
<field name="email_from">${user.email_formatted | safe}</field>
<field name="email_from">${(object.company_id.email_formatted or object.email_formatted) |safe}</field>
<field name="email_to">${object.email_formatted | safe}</field>
<field name="body_html" type="html">
<table border="0" cellpadding="0" cellspacing="0" style="padding-top: 16px; background-color: #F1F1F1; color: #454748; width: 100%; border-collapse:separate;"><tr><td align="center">