[IMP] mail_plugin: improve error message when the email is not valid

Purpose
=======
Improve the error message when the email
of the contact / company is not valid.

Task-2601837

closes odoo/odoo#86080

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
This commit is contained in:
std-odoo
2022-04-27 11:06:14 +02:00
parent 24fa2495e5
commit 9323cee2f2
@@ -43,7 +43,7 @@ class MailPluginController(http.Controller):
normalized_email = partner.email_normalized
if not normalized_email:
return {'error': _('Contact has no valid email')}
return {'error': _('The email of this contact is not valid and we can not enrich it')}
company, enrichment_info = self._create_company_from_iap(normalized_email)
@@ -70,7 +70,7 @@ class MailPluginController(http.Controller):
normalized_email = partner.email_normalized
if not normalized_email:
return {'error': 'Contact has no valid email'}
return {'error': 'The email of this contact is not valid and we can not enrich it'}
domain = tools.email_domain_extract(normalized_email)
iap_data = self._iap_enrich(domain)