mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-19 21:19:19 +00:00
profile: added email signature to outgoing mail and profile settings
This commit is contained in:
@@ -105,26 +105,26 @@ class DocType(TransactionBase):
|
|||||||
d = webnotes.doc('Communication')
|
d = webnotes.doc('Communication')
|
||||||
d.subject = self.doc.subject
|
d.subject = self.doc.subject
|
||||||
d.email_address = from_email or webnotes.user.name
|
d.email_address = from_email or webnotes.user.name
|
||||||
email_addr = email.utils.parseaddr(d.email_address)[1]
|
|
||||||
self.set_lead_and_contact(d)
|
self.set_lead_and_contact(d)
|
||||||
d.support_ticket = self.doc.name
|
d.support_ticket = self.doc.name
|
||||||
d.content = response
|
d.content = response
|
||||||
d.communication_medium = "Email"
|
d.communication_medium = "Email"
|
||||||
d.save(1)
|
d.save(1)
|
||||||
|
|
||||||
def set_lead_and_contact(self, d, email_addr):
|
def set_lead_and_contact(self, d):
|
||||||
|
email_addr = email.utils.parseaddr(d.email_address)
|
||||||
# set contact
|
# set contact
|
||||||
if self.doc.contact:
|
if self.doc.contact:
|
||||||
d.contact = self.doc.contact
|
d.contact = self.doc.contact
|
||||||
else:
|
else:
|
||||||
d.contact = webnotes.conn.get_value("Contact", {"email_id": email_addr}, "name") or None
|
d.contact = webnotes.conn.get_value("Contact", {"email_id": email_addr[1]}, "name") or None
|
||||||
if d.contact:
|
if d.contact:
|
||||||
webnotes.conn.set(self.doc, "contact", d.contact)
|
webnotes.conn.set(self.doc, "contact", d.contact)
|
||||||
|
|
||||||
if self.doc.lead:
|
if self.doc.lead:
|
||||||
d.lead = self.doc.lead
|
d.lead = self.doc.lead
|
||||||
else:
|
else:
|
||||||
d.lead = webnotes.conn.get_value("Lead", {"email_id": email_addr}, "name") or None
|
d.lead = webnotes.conn.get_value("Lead", {"email_id": email_addr[1]}, "name") or None
|
||||||
if d.lead:
|
if d.lead:
|
||||||
webnotes.conn.set(self.doc, "lead", d.lead)
|
webnotes.conn.set(self.doc, "lead", d.lead)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user