do not style inline if in test case
This commit is contained in:
parent
090d38a0f3
commit
67b5f98892
2 changed files with 9 additions and 7 deletions
|
|
@ -145,4 +145,4 @@ def flush(from_test=False):
|
|||
def clear_outbox():
|
||||
"""remove mails older than 30 days in Outbox"""
|
||||
frappe.conn.sql("""delete from `tabBulk Email` where
|
||||
datediff(now(), creation) > 30""")
|
||||
datediff(now(), creation) > 30""")
|
||||
|
|
|
|||
|
|
@ -192,17 +192,19 @@ class EMail:
|
|||
return self.msg_root.as_string()
|
||||
|
||||
def get_formatted_html(subject, message, footer=None, print_html=None):
|
||||
if frappe.local.flags.in_test:
|
||||
return message
|
||||
|
||||
message = scrub_urls(message)
|
||||
|
||||
return inline_css(frappe.get_template("templates/emails/standard.html").render({
|
||||
rendered_email = frappe.get_template("templates/emails/standard.html").render({
|
||||
"content": message,
|
||||
"footer": get_footer(footer),
|
||||
"title": subject,
|
||||
"print_html": print_html
|
||||
}))
|
||||
})
|
||||
|
||||
# if in a test case, do not inline css
|
||||
if frappe.local.flags.in_test:
|
||||
return rendered_email
|
||||
|
||||
return inline_css(rendered_email)
|
||||
|
||||
def get_footer(footer=None):
|
||||
"""append a footer (signature)"""
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue