fix: Support bundled asset for email css

This commit is contained in:
Faris Ansari 2021-04-29 14:40:15 +05:30
parent aac5423600
commit 9a00ce43ea
2 changed files with 3 additions and 1 deletions

View file

@ -291,9 +291,11 @@ def inline_style_in_html(html):
''' Convert email.css and html to inline-styled html
'''
from premailer import Premailer
from frappe.utils.jinja_globals import bundled_asset
# get email css files from hooks
css_files = frappe.get_hooks('email_css')
css_files = [bundled_asset(path) for path in css_files]
css_files = [path.lstrip('/') for path in css_files]
css_files = [css_file for css_file in css_files if os.path.exists(os.path.abspath(css_file))]

View file

@ -52,7 +52,7 @@ web_include_js = [
web_include_css = []
email_css = ['/assets/frappe/dist/css/email.bundle.css']
email_css = ['email.bundle.css']
website_route_rules = [
{"from_route": "/blog/<category>", "to_route": "Blog Post"},