mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-16 11:39:18 +00:00
fixes in receive email
This commit is contained in:
@@ -68,6 +68,8 @@ class SupportMailbox(POP3Mailbox):
|
|||||||
re_result = re.findall('(?<=\<)(\S+)(?=\>)', mail.mail['From'])
|
re_result = re.findall('(?<=\<)(\S+)(?=\>)', mail.mail['From'])
|
||||||
if re_result and re_result[0]: email_id = re_result[0]
|
if re_result and re_result[0]: email_id = re_result[0]
|
||||||
|
|
||||||
|
from webnotes.utils import decode_email_header
|
||||||
|
full_email_id = decode_email_header(mail.mail['From'])
|
||||||
|
|
||||||
for thread_id in thread_list:
|
for thread_id in thread_list:
|
||||||
exists = webnotes.conn.sql("""\
|
exists = webnotes.conn.sql("""\
|
||||||
@@ -79,7 +81,7 @@ class SupportMailbox(POP3Mailbox):
|
|||||||
from webnotes.model.code import get_obj
|
from webnotes.model.code import get_obj
|
||||||
|
|
||||||
st = get_obj('Support Ticket', thread_id)
|
st = get_obj('Support Ticket', thread_id)
|
||||||
st.make_response_record(content, mail.mail['From'], content_type)
|
st.make_response_record(content, full_email_id, content_type)
|
||||||
|
|
||||||
# to update modified date
|
# to update modified date
|
||||||
#webnotes.conn.set(st.doc, 'status', 'Open')
|
#webnotes.conn.set(st.doc, 'status', 'Open')
|
||||||
@@ -99,7 +101,7 @@ class SupportMailbox(POP3Mailbox):
|
|||||||
d = Document('Support Ticket')
|
d = Document('Support Ticket')
|
||||||
d.description = content
|
d.description = content
|
||||||
d.subject = mail.mail['Subject']
|
d.subject = mail.mail['Subject']
|
||||||
d.raised_by = mail.mail['From']
|
d.raised_by = full_email_id
|
||||||
d.content_type = content_type
|
d.content_type = content_type
|
||||||
d.status = 'Open'
|
d.status = 'Open'
|
||||||
d.naming_series = opts and opts.split("\n")[0] or 'SUP'
|
d.naming_series = opts and opts.split("\n")[0] or 'SUP'
|
||||||
|
|||||||
Reference in New Issue
Block a user