-
- Downloads
[FIX] hr_recruitment: parse email and partner name
Issue:
------
When applying for a job via an alias mail,
it is sometimes possible to get the wrong information
for the applicant's name and email.
For example:
Applicant's Name: "FirstName SecondName
Email: "FirstName SecondName" <name@example.com>
Because of this, it is not possible to send an e-mail
(for example, to set up a meeting)
because the latter is erroneous.
Cause:
------
Many e-mail services add the name associated with the e-mail in the header.
Example of a sent e-mail (can be retrieved with "Show original"):
```eml
MIME-Version: 1.0
Date: Wed, 21 Jun 2023 12:09:34 +0200
Message-ID: <CAHbiOmS_PHojqKMhoji9iev4I6pzuJ1=dVHgLKNh3SOS_mw7+w@mail.gmail.com>
Subject: Subject test
From: FirstName SecondName <name@example.com>
To: team-recruitment@company.com
Content-Type: multipart/alternative; boundary="000000000000f7db4305fea0f6c3"
--000000000000f7db4305fea0f6c3
Content-Type: text/plain; charset="UTF-8"
Message test
--000000000000f7db4305fea0f6c3
Content-Type: text/html; charset="UTF-8"
<div dir="ltr">Message test<br></div>
--000000000000f7db4305fea0f6c3--
```
Solution:
---------
Use `_parse_partner_name` method
to correctly parse the e-mail
and partner's name.
Note:
-----
Not add `email_from` in `_primary_email` field.
Otherwise, they will be override with the "raw" value.
opw-3347313
closes odoo/odoo#125927
Signed-off-by:
Kevin Baptiste <kba@odoo.com>
Please register or sign in to comment