Skip to content

Commit bd2770d

Browse files
committed
[FIX] auth_signup: escape double quotes in email from value
Steps to reproduce: - Install "Sales" module (for test purpose) - Change company name to `בונז " ור מונד` (notice the double quotes) - Go to "Settings > Users & Companies > Users" - Select any user and then click on "send an invitation email" button - Go to inbox and check the email Issue: No email received (at least not in main inbox). Cause: The email is not received in main inbox (Gmail or Outlook might flag them since email from is not well parsed) because the `email from` value is not escaped properly (by escaping the double quotes). Solution: Instead of using the company name (that is not escaped) and email to build the `email from` value, use the company email_formatted value instead (and fallback on user mail if not available). opw-3097910 closes odoo#114519 X-original-commit: 0c4cb5e Signed-off-by: Julien Castiaux (juc) <juc@odoo.com>
1 parent bccdf65 commit bd2770d

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

addons/auth_signup/data/mail_template_data.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<field name="name">Settings: User Reset Password</field>
77
<field name="model_id" ref="base.model_res_users"/>
88
<field name="subject">Password reset</field>
9-
<field name="email_from">"{{ object.company_id.name }}" &lt;{{ (object.company_id.email or user.email) }}&gt;</field>
9+
<field name="email_from">{{ (object.company_id.email_formatted or user.email_formatted) }}</field>
1010
<field name="email_to">{{ object.email_formatted }}</field>
1111
<field name="description">Sent to user who requested a password reset</field>
1212
<field name="body_html" type="html">
@@ -102,7 +102,7 @@
102102
<field name="name">Settings: New Portal Signup</field>
103103
<field name="model_id" ref="base.model_res_users"/>
104104
<field name="subject">{{ object.create_uid.name }} from {{ object.company_id.name }} invites you to connect to Odoo</field>
105-
<field name="email_from">"{{ object.company_id.name }}" &lt;{{ (object.company_id.email or user.email) }}&gt;</field>
105+
<field name="email_from">{{ (object.company_id.email_formatted or user.email_formatted) }}</field>
106106
<field name="email_to">{{ object.email_formatted }}</field>
107107
<field name="description">Sent to new user after you invited them</field>
108108
<field name="body_html" type="html">
@@ -250,7 +250,7 @@
250250
<field name="name">Settings: New User Invite</field>
251251
<field name="model_id" ref="base.model_res_users"/>
252252
<field name="subject">Welcome to {{ object.company_id.name }}!</field>
253-
<field name="email_from">"{{ object.company_id.name }}" &lt;{{ (object.company_id.email or user.email) }}&gt;</field>
253+
<field name="email_from">{{ (object.company_id.email_formatted or user.email_formatted) }}</field>
254254
<field name="email_to">{{ object.email_formatted }}</field>
255255
<field name="description">Sent to portal user who registered themselves</field>
256256
<field name="body_html" type="html">

addons/auth_totp_mail_enforce/data/mail_template_data.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<field name="model_id" ref="base.model_res_users" />
77
<field name="subject">Your two-factor authentication code</field>
88
<field name="email_to">{{ object.email_formatted }}</field>
9-
<field name="email_from">"{{ object.company_id.name }}" &lt;{{ (object.company_id.email or user.email) }}&gt;</field>
9+
<field name="email_from">{{ (object.company_id.email_formatted or user.email_formatted) }}</field>
1010
<field name="lang">{{ object.partner_id.lang }}</field>
1111
<field name="auto_delete" eval="True"/>
1212
<field name="body_html" type="html">

0 commit comments

Comments
 (0)