Merge pull request #1880 from rmehta/fixes-july-2

formatting fix in support ticket autoreply
This commit is contained in:
Anand Doshi 2014-07-02 18:13:55 +05:30
commit 57f76e936a
2 changed files with 20 additions and 18 deletions

View File

@ -56,6 +56,7 @@ class Customer(TransactionBase):
(self.name, self.customer_name, self.lead_name)) (self.name, self.customer_name, self.lead_name))
lead = frappe.db.get_value("Lead", self.lead_name, ["lead_name", "email_id", "phone", "mobile_no"], as_dict=True) lead = frappe.db.get_value("Lead", self.lead_name, ["lead_name", "email_id", "phone", "mobile_no"], as_dict=True)
c = frappe.new_doc('Contact') c = frappe.new_doc('Contact')
c.first_name = lead.lead_name c.first_name = lead.lead_name
c.email_id = lead.email_id c.email_id = lead.email_id
@ -65,10 +66,9 @@ class Customer(TransactionBase):
c.customer_name = self.customer_name c.customer_name = self.customer_name
c.is_primary_contact = 1 c.is_primary_contact = 1
c.ignore_permissions = getattr(self, "ignore_permissions", None) c.ignore_permissions = getattr(self, "ignore_permissions", None)
try: c.autoname()
c.save() if not frappe.db.exists("Contact", c.name):
except frappe.NameError: c.insert()
pass
def on_update(self): def on_update(self):
self.validate_name_with_customer_group() self.validate_name_with_customer_group()

View File

@ -40,11 +40,13 @@ class SupportMailbox(POP3Mailbox):
A new Ticket has been raised for your query. If you have any additional information, please A new Ticket has been raised for your query. If you have any additional information, please
reply back to this mail. reply back to this mail.
We will get back to you as soon as possible ### We will get back to you as soon as possible
----------------------
---
Original Query: Original Query:
""" + d.description + "\n----------------------\n" + cstr(signature)) """ + d.description + "\n\n---\n\n" + cstr(signature))
sendmail(\ sendmail(\
recipients = [cstr(d.raised_by)], \ recipients = [cstr(d.raised_by)], \