Merge branch 'staging-fixes' into staging
This commit is contained in:
commit
321e45925a
6 changed files with 60 additions and 17 deletions
|
|
@ -1124,7 +1124,7 @@
|
|||
"istable": 0,
|
||||
"max_attachments": 0,
|
||||
"menu_index": 0,
|
||||
"modified": "2018-08-29 14:32:02.179599",
|
||||
"modified": "2018-10-05 14:32:02.179599",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Email",
|
||||
"name": "Notification",
|
||||
|
|
|
|||
|
|
@ -133,14 +133,16 @@ def get_context(context):
|
|||
subject = frappe.render_template(self.subject, context)
|
||||
|
||||
attachments = self.get_attachment(doc)
|
||||
recipients = self.get_list_of_recipients(doc, context)
|
||||
recipients, cc, bcc = self.get_list_of_recipients(doc, context)
|
||||
sender = None
|
||||
if self.sender and self.sender_email:
|
||||
sender = formataddr((self.sender, self.sender_email))
|
||||
|
||||
frappe.sendmail(recipients=recipients, subject=subject,
|
||||
sender=sender,
|
||||
message= frappe.render_template(self.message, context),
|
||||
frappe.sendmail(recipients = recipients,
|
||||
subject = subject,
|
||||
sender = sender,
|
||||
cc = cc,
|
||||
bcc = bcc,
|
||||
message = frappe.render_template(self.message, context),
|
||||
reference_doctype = doc.doctype,
|
||||
reference_name = doc.name,
|
||||
attachments = attachments,
|
||||
|
|
@ -156,6 +158,8 @@ def get_context(context):
|
|||
|
||||
def get_list_of_recipients(self, doc, context):
|
||||
recipients = []
|
||||
cc = []
|
||||
bcc = []
|
||||
for recipient in self.recipients:
|
||||
if recipient.condition:
|
||||
if not frappe.safe_eval(recipient.condition, None, context):
|
||||
|
|
@ -173,7 +177,14 @@ def get_context(context):
|
|||
|
||||
if recipient.cc:
|
||||
recipient.cc = recipient.cc.replace(",", "\n")
|
||||
recipients = recipients + recipient.cc.split("\n")
|
||||
cc = cc + recipient.cc.split("\n")
|
||||
|
||||
if recipient.bcc and "{" in recipient.bcc:
|
||||
recipient.bcc = frappe.render_template(recipient.bcc, context)
|
||||
|
||||
if recipient.bcc:
|
||||
recipient.bcc = recipient.bcc.replace(",", "\n")
|
||||
bcc = bcc + recipient.bcc.split("\n")
|
||||
|
||||
#For sending emails to specified role
|
||||
if recipient.email_by_role:
|
||||
|
|
@ -182,10 +193,9 @@ def get_context(context):
|
|||
for email in emails:
|
||||
recipients = recipients + email.split("\n")
|
||||
|
||||
if not recipients:
|
||||
return
|
||||
|
||||
return list(set(recipients))
|
||||
if not recipients and not cc and not bcc:
|
||||
return None, None, None
|
||||
return list(set(recipients)), list(set(cc)), list(set(bcc))
|
||||
|
||||
def get_attachment(self, doc):
|
||||
""" check print settings are attach the pdf """
|
||||
|
|
@ -285,7 +295,6 @@ def evaluate_alert(doc, alert, event):
|
|||
# reload the doc for the latest values & comments,
|
||||
# except for validate type event.
|
||||
doc = frappe.get_doc(doc.doctype, doc.name)
|
||||
|
||||
alert.send(doc)
|
||||
except TemplateError:
|
||||
frappe.throw(_("Error while evaluating Notification {0}. Please fix your template.").format(alert))
|
||||
|
|
|
|||
|
|
@ -110,6 +110,38 @@
|
|||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "bcc",
|
||||
"fieldtype": "Code",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "BCC",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
|
|
@ -153,7 +185,7 @@
|
|||
"issingle": 0,
|
||||
"istable": 1,
|
||||
"max_attachments": 0,
|
||||
"modified": "2018-05-31 15:44:44.161293",
|
||||
"modified": "2018-09-03 18:37:57.043251",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Email",
|
||||
"name": "Notification Recipient",
|
||||
|
|
@ -167,5 +199,6 @@
|
|||
"sort_field": "modified",
|
||||
"sort_order": "DESC",
|
||||
"track_changes": 0,
|
||||
"track_seen": 0
|
||||
"track_seen": 0,
|
||||
"track_views": 0
|
||||
}
|
||||
|
|
@ -209,7 +209,6 @@ class EMail:
|
|||
"To": ', '.join(self.recipients) if self.expose_recipients=="header" else "<!--recipient-->",
|
||||
"Date": email.utils.formatdate(),
|
||||
"Reply-To": self.reply_to if self.reply_to else None,
|
||||
"Bcc": ', '.join(self.bcc) if self.bcc else None,
|
||||
"CC": ', '.join(self.cc) if self.cc and self.expose_recipients=="header" else None,
|
||||
'X-Frappe-Site': get_url(),
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ source_link = "https://github.com/frappe/frappe"
|
|||
app_license = "MIT"
|
||||
|
||||
develop_version = '11.x.x-develop'
|
||||
staging_version = '11.0.3-beta.20'
|
||||
staging_version = '11.0.3-beta.21'
|
||||
|
||||
app_email = "info@frappe.io"
|
||||
|
||||
|
|
|
|||
|
|
@ -158,7 +158,9 @@ acceptable_attributes = [
|
|||
'step', 'style', 'summary', 'suppress', 'tabindex', 'target',
|
||||
'template', 'title', 'toppadding', 'type', 'unselectable', 'usemap',
|
||||
'urn', 'valign', 'value', 'variable', 'volume', 'vspace', 'vrml',
|
||||
'width', 'wrap', 'xml:lang', 'data-row'
|
||||
'width', 'wrap', 'xml:lang', 'data-row', 'data-list', 'data-language',
|
||||
'data-value', 'role', 'frameborder', 'allowfullscreen', 'spellcheck',
|
||||
'data-mode', 'data-gramm', 'data-placeholder'
|
||||
]
|
||||
|
||||
mathml_attributes = [
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue