mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-31 18:59:08 +00:00
fix: child table naming
This commit is contained in:
@@ -26,7 +26,7 @@ class EmailCampaign(Document):
|
|||||||
|
|
||||||
#set the end date as start date + max(send after days) in campaign schedule
|
#set the end date as start date + max(send after days) in campaign schedule
|
||||||
send_after_days = []
|
send_after_days = []
|
||||||
for entry in campaign.get("campaign_schedule"):
|
for entry in campaign.get("campaign_schedules"):
|
||||||
send_after_days.append(entry.send_after_days)
|
send_after_days.append(entry.send_after_days)
|
||||||
end_date = add_days(getdate(self.start_date), max(send_after_days))
|
end_date = add_days(getdate(self.start_date), max(send_after_days))
|
||||||
|
|
||||||
@@ -56,8 +56,8 @@ def send_email_to_leads():
|
|||||||
email_campaigns = frappe.get_all("Email Campaign", filters = { 'status': ('not in', ['Unsubscribed', 'Completed', 'Scheduled']) })
|
email_campaigns = frappe.get_all("Email Campaign", filters = { 'status': ('not in', ['Unsubscribed', 'Completed', 'Scheduled']) })
|
||||||
for camp in email_campaigns:
|
for camp in email_campaigns:
|
||||||
email_campaign = frappe.get_doc("Email Campaign", camp.name)
|
email_campaign = frappe.get_doc("Email Campaign", camp.name)
|
||||||
campaign = frappe.get_doc("Campaign", email_campaign.campaign_name)
|
campaign = frappe.get_cached_doc("Campaign", email_campaign.campaign_name)
|
||||||
for entry in campaign.get("campaign_schedule"):
|
for entry in campaign.get("campaign_schedules"):
|
||||||
scheduled_date = add_days(email_campaign.get('start_date'), entry.get('send_after_days'))
|
scheduled_date = add_days(email_campaign.get('start_date'), entry.get('send_after_days'))
|
||||||
if scheduled_date == getdate(today()):
|
if scheduled_date == getdate(today()):
|
||||||
send_mail(entry, email_campaign)
|
send_mail(entry, email_campaign)
|
||||||
@@ -82,7 +82,6 @@ def send_mail(entry, email_campaign):
|
|||||||
email_template = email_template.name
|
email_template = email_template.name
|
||||||
)
|
)
|
||||||
|
|
||||||
@frappe.whitelist(allow_guest=True)
|
|
||||||
#called from hooks on doc_event Email Unsubscribe
|
#called from hooks on doc_event Email Unsubscribe
|
||||||
def unsubscribe_recipient(unsubscribe, method):
|
def unsubscribe_recipient(unsubscribe, method):
|
||||||
if unsubscribe.reference_doctype == 'Email Campaign':
|
if unsubscribe.reference_doctype == 'Email Campaign':
|
||||||
|
|||||||
@@ -19,9 +19,8 @@
|
|||||||
"currency",
|
"currency",
|
||||||
"column_break2",
|
"column_break2",
|
||||||
"budget",
|
"budget",
|
||||||
"schedule_section",
|
"campaign_schedules_section",
|
||||||
"campaign_schedule_section",
|
"campaign_schedules",
|
||||||
"campaign_schedule",
|
|
||||||
"description_section",
|
"description_section",
|
||||||
"description"
|
"description"
|
||||||
],
|
],
|
||||||
@@ -104,24 +103,20 @@
|
|||||||
"label": "BUDGET"
|
"label": "BUDGET"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "campaign_schedule_section",
|
"fieldname": "campaign_schedules",
|
||||||
"fieldtype": "Section Break",
|
|
||||||
"label": "Campaign Schedule"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldname": "campaign_schedule",
|
|
||||||
"fieldtype": "Table",
|
"fieldtype": "Table",
|
||||||
"label": "Campaign Schedule",
|
"label": "Campaign Schedules",
|
||||||
"options": "Campaign Email Schedule"
|
"options": "Campaign Email Schedule"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "schedule_section",
|
"fieldname": "campaign_schedules_section",
|
||||||
"fieldtype": "Section Break"
|
"fieldtype": "Section Break",
|
||||||
|
"label": "Campaign Schedules"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"icon": "fa fa-bullhorn",
|
"icon": "fa fa-bullhorn",
|
||||||
"idx": 1,
|
"idx": 1,
|
||||||
"modified": "2019-07-12 11:52:47.196736",
|
"modified": "2019-07-15 17:45:06.168107",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Selling",
|
"module": "Selling",
|
||||||
"name": "Campaign",
|
"name": "Campaign",
|
||||||
|
|||||||
Reference in New Issue
Block a user