Sfoglia il codice sorgente

fix: email_string parsing when pulling email

version-14
Ahmad 3 anni fa
parent
commit
6afa5c8da3
1 ha cambiato i file con 4 aggiunte e 5 eliminazioni
  1. +4
    -5
      frappe/core/doctype/communication/communication.py

+ 4
- 5
frappe/core/doctype/communication/communication.py Vedi File

@@ -12,7 +12,7 @@ from frappe.core.utils import get_parent_doc
from frappe.utils.bot import BotReply
from frappe.utils import parse_addr, split_emails
from frappe.core.doctype.comment.comment import update_comment_in_doc
from email.utils import parseaddr
from email.utils import getaddresses
from urllib.parse import unquote
from frappe.utils.user import is_system_user
from frappe.contacts.doctype.contact.contact import get_contact_name
@@ -372,10 +372,9 @@ def get_contacts(email_strings, auto_create_contact=False):

for email_string in email_strings:
if email_string:
for email in email_string.split(","):
parsed_email = parseaddr(email)[1]
if parsed_email:
email_addrs.append(parsed_email)
result = getaddresses(email_string)
for email in result:
email_addrs.append(email[1])

contacts = []
for email in email_addrs:


Caricamento…
Annulla
Salva