Pass sender as contact email in Opportunity (#11308)
Always pass sender as the contact email while creating an opportunity for a website enquiry.
diff --git a/erpnext/templates/utils.py b/erpnext/templates/utils.py
index 6ebe411..7ee3960 100644
--- a/erpnext/templates/utils.py
+++ b/erpnext/templates/utils.py
@@ -28,11 +28,12 @@
)).insert(ignore_permissions=True)
opportunity = frappe.get_doc(dict(
- doctype='Opportunity',
+ doctype ='Opportunity',
enquiry_from = 'Customer' if customer else 'Lead',
status = 'Open',
title = subject,
- to_discuss=message
+ contact_email = sender,
+ to_discuss = message
))
if customer: