From 88de00fb9496e8f67f2970bc35104bbb5e952584 Mon Sep 17 00:00:00 2001 From: "FinByz Tech Pvt. Ltd" Date: Thu, 17 Oct 2019 17:12:23 +0530 Subject: [PATCH 1/2] Rendered Email template in email Campaign --- erpnext/crm/doctype/email_campaign/email_campaign.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/crm/doctype/email_campaign/email_campaign.py b/erpnext/crm/doctype/email_campaign/email_campaign.py index 98e4927beb..6ea24a5f20 100644 --- a/erpnext/crm/doctype/email_campaign/email_campaign.py +++ b/erpnext/crm/doctype/email_campaign/email_campaign.py @@ -73,13 +73,13 @@ def send_mail(entry, email_campaign): 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", From 4c7ac65db1174d6659547741631f141cec905931 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Mon, 11 Nov 2019 17:19:52 +0530 Subject: [PATCH 2/2] fix: Made Campaign for field mandatory --- erpnext/crm/doctype/email_campaign/email_campaign.json | 5 +++-- erpnext/crm/doctype/email_campaign/email_campaign.py | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/erpnext/crm/doctype/email_campaign/email_campaign.json b/erpnext/crm/doctype/email_campaign/email_campaign.json index 3259136275..736a9d6173 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 6ea24a5f20..3050d05a7c 100644 --- a/erpnext/crm/doctype/email_campaign/email_campaign.py +++ b/erpnext/crm/doctype/email_campaign/email_campaign.py @@ -73,13 +73,13 @@ def send_mail(entry, email_campaign): 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) } + 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 = frappe.render_template(email_template.get("response"),context), + content = frappe.render_template(email_template.get("response"), context), sender = sender, recipients = recipient, communication_medium = "Email",