Merge branch 'finbyz-develop' into develop
diff --git a/erpnext/crm/doctype/email_campaign/email_campaign.json b/erpnext/crm/doctype/email_campaign/email_campaign.json
index 3259136..736a9d6 100644
--- a/erpnext/crm/doctype/email_campaign/email_campaign.json
+++ b/erpnext/crm/doctype/email_campaign/email_campaign.json
@@ -52,7 +52,8 @@
"fieldtype": "Select",
"in_list_view": 1,
"label": "Email Campaign For ",
- "options": "\nLead\nContact"
+ "options": "\nLead\nContact",
+ "reqd": 1
},
{
"fieldname": "recipient",
@@ -69,7 +70,7 @@
"options": "User"
}
],
- "modified": "2019-07-12 13:47:37.261213",
+ "modified": "2019-11-11 17:18:47.342839",
"modified_by": "Administrator",
"module": "CRM",
"name": "Email Campaign",
diff --git a/erpnext/crm/doctype/email_campaign/email_campaign.py b/erpnext/crm/doctype/email_campaign/email_campaign.py
index 98e4927..3050d05 100644
--- a/erpnext/crm/doctype/email_campaign/email_campaign.py
+++ b/erpnext/crm/doctype/email_campaign/email_campaign.py
@@ -73,13 +73,13 @@
email_template = frappe.get_doc("Email Template", entry.get("email_template"))
sender = frappe.db.get_value("User", email_campaign.get("sender"), 'email')
-
+ context = {"doc": frappe.get_doc(email_campaign.email_campaign_for, email_campaign.recipient)}
# send mail and link communication to document
comm = make(
doctype = "Email Campaign",
name = email_campaign.name,
subject = email_template.get("subject"),
- content = email_template.get("response"),
+ content = frappe.render_template(email_template.get("response"), context),
sender = sender,
recipients = recipient,
communication_medium = "Email",