From c2f89c7bbbf7e806ae238ebcde0dbfe13ee6de6c Mon Sep 17 00:00:00 2001 From: "Nasreddin Boulif (bon)" Date: Tue, 28 Feb 2023 15:55:46 +0000 Subject: [PATCH] [FIX] auth_signup: escape double quotes in `email from` value MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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/odoo#114534 X-original-commit: 0c4cb5e3cc2758cb27e94ecbbcfaa734ba5a50eb Signed-off-by: Julien Castiaux (juc) --- addons/auth_signup/data/mail_template_data.xml | 6 +++--- addons/auth_totp_mail_enforce/data/mail_template_data.xml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/auth_signup/data/mail_template_data.xml b/addons/auth_signup/data/mail_template_data.xml index 4166e5f37e3..717ec810875 100644 --- a/addons/auth_signup/data/mail_template_data.xml +++ b/addons/auth_signup/data/mail_template_data.xml @@ -6,7 +6,7 @@ Settings: User Reset Password Password reset - "{{ object.company_id.name }}" <{{ (object.company_id.email or user.email) }}> + {{ (object.company_id.email_formatted or user.email_formatted) }} {{ object.email_formatted }} Sent to user who requested a password reset @@ -102,7 +102,7 @@ Settings: New Portal Signup {{ object.create_uid.name }} from {{ object.company_id.name }} invites you to connect to Odoo - "{{ object.company_id.name }}" <{{ (object.company_id.email or user.email) }}> + {{ (object.company_id.email_formatted or user.email_formatted) }} {{ object.email_formatted }} Sent to new user after you invited them @@ -250,7 +250,7 @@ Settings: New User Invite Welcome to {{ object.company_id.name }}! - "{{ object.company_id.name }}" <{{ (object.company_id.email or user.email) }}> + {{ (object.company_id.email_formatted or user.email_formatted) }} {{ object.email_formatted }} Sent to portal user who registered themselves diff --git a/addons/auth_totp_mail_enforce/data/mail_template_data.xml b/addons/auth_totp_mail_enforce/data/mail_template_data.xml index e95d83b51f1..5593dcad2af 100644 --- a/addons/auth_totp_mail_enforce/data/mail_template_data.xml +++ b/addons/auth_totp_mail_enforce/data/mail_template_data.xml @@ -6,7 +6,7 @@ Your two-factor authentication code {{ object.email_formatted }} - "{{ object.company_id.name }}" <{{ (object.company_id.email or user.email) }}> + {{ (object.company_id.email_formatted or user.email_formatted) }} {{ object.partner_id.lang }}