trying to fix support ticket
This commit is contained in:
parent
2b60484bab
commit
a872d81983
@ -47,7 +47,7 @@ feed_dict = {
|
||||
# Support
|
||||
'Customer Issue': ['[%(status)s] %(description)s by %(customer_name)s', '#000080'],
|
||||
'Maintenance Visit':['To %(customer_name)s', '#4169E1'],
|
||||
'Support Ticket': ['[%(status)s] %(subject)s', '#000080'],
|
||||
'Support Ticket': ["[%(status)s] %(subject)s", '#000080'],
|
||||
|
||||
# Website
|
||||
'Web Page': ['%(title)s', '#000080'],
|
||||
|
@ -81,6 +81,7 @@ class SupportMailbox(POP3Mailbox):
|
||||
st.make_response_record(content, mail.mail['From'], content_type)
|
||||
webnotes.conn.set(st.doc, 'status', 'Open')
|
||||
update_feed(st.doc, 'on_update')
|
||||
webnotes.conn.commit()
|
||||
# extract attachments
|
||||
self.save_attachments(st.doc, mail.attachments)
|
||||
return
|
||||
@ -99,21 +100,22 @@ class SupportMailbox(POP3Mailbox):
|
||||
d.naming_series = (opts and opts[0] and opts[0][0] and opts[0][0].split("\n")[0]) or 'SUP'
|
||||
try:
|
||||
d.save(1)
|
||||
except:
|
||||
d.description = 'Unable to extract message'
|
||||
d.save(1)
|
||||
|
||||
else:
|
||||
# update feed
|
||||
update_feed(d, 'on_update')
|
||||
|
||||
# send auto reply
|
||||
self.send_auto_reply(d)
|
||||
|
||||
except:
|
||||
d.description = 'Unable to extract message'
|
||||
d.save(1)
|
||||
|
||||
else:
|
||||
webnotes.conn.commit()
|
||||
|
||||
# extract attachments
|
||||
self.save_attachments(d, mail.attachments)
|
||||
|
||||
|
||||
|
||||
def save_attachments(self, doc, attachment_list=[]):
|
||||
"""
|
||||
@ -138,7 +140,7 @@ class SupportMailbox(POP3Mailbox):
|
||||
"""
|
||||
Send auto reply to emails
|
||||
"""
|
||||
signature = self.email_settings.support_signature
|
||||
signature = self.email_settings.support_signature or ''
|
||||
|
||||
response = self.email_settings.support_autoreply or ("""
|
||||
A new Ticket has been raised for your query. If you have any additional information, please
|
||||
@ -148,7 +150,7 @@ We will get back to you as soon as possible
|
||||
|
||||
[This is an automatic response]
|
||||
|
||||
""" + (signature or ''))
|
||||
""" + signature)
|
||||
|
||||
from webnotes.utils.email_lib import sendmail
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user