mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-31 10:49:09 +00:00
send support ticket response at the end of all operations
This commit is contained in:
@@ -36,6 +36,7 @@ class SupportMailbox(POP3Mailbox):
|
|||||||
return
|
return
|
||||||
thread_id = mail.get_thread_id()
|
thread_id = mail.get_thread_id()
|
||||||
ticket = None
|
ticket = None
|
||||||
|
new_ticket = False
|
||||||
|
|
||||||
if thread_id and webnotes.conn.exists("Support Ticket", thread_id):
|
if thread_id and webnotes.conn.exists("Support Ticket", thread_id):
|
||||||
ticket = webnotes.bean("Support Ticket", thread_id)
|
ticket = webnotes.bean("Support Ticket", thread_id)
|
||||||
@@ -52,16 +53,17 @@ class SupportMailbox(POP3Mailbox):
|
|||||||
"status": "Open"
|
"status": "Open"
|
||||||
}])
|
}])
|
||||||
ticket.insert()
|
ticket.insert()
|
||||||
|
new_ticket = True
|
||||||
if cint(self.email_settings.send_autoreply):
|
|
||||||
if "mailer-daemon" not in mail.from_email.lower():
|
|
||||||
self.send_auto_reply(ticket.doc)
|
|
||||||
|
|
||||||
mail.save_attachments_in_doc(ticket.doc)
|
mail.save_attachments_in_doc(ticket.doc)
|
||||||
|
|
||||||
make(content=mail.content, sender=mail.from_email, subject = ticket.doc.subject,
|
make(content=mail.content, sender=mail.from_email, subject = ticket.doc.subject,
|
||||||
doctype="Support Ticket", name=ticket.doc.name,
|
doctype="Support Ticket", name=ticket.doc.name,
|
||||||
lead = ticket.doc.lead, contact=ticket.doc.contact, date=mail.date)
|
lead = ticket.doc.lead, contact=ticket.doc.contact, date=mail.date)
|
||||||
|
|
||||||
|
if new_ticket and cint(self.email_settings.send_autoreply) and \
|
||||||
|
"mailer-daemon" not in mail.from_email.lower():
|
||||||
|
self.send_auto_reply(ticket.doc)
|
||||||
|
|
||||||
def send_auto_reply(self, d):
|
def send_auto_reply(self, d):
|
||||||
signature = self.email_settings.fields.get('support_signature') or ''
|
signature = self.email_settings.fields.get('support_signature') or ''
|
||||||
|
|||||||
Reference in New Issue
Block a user