diff --git a/frappe/core/doctype/communication/communication.py b/frappe/core/doctype/communication/communication.py index d55d89cdea..dc7f150909 100644 --- a/frappe/core/doctype/communication/communication.py +++ b/frappe/core/doctype/communication/communication.py @@ -110,6 +110,7 @@ def get_customer_supplier(args=None): def send_comm_email(d, name, sent_via=None, print_html=None, attachments='[]', send_me_a_copy=False): footer = None + if sent_via: if hasattr(sent_via, "get_sender"): d.sender = sent_via.get_sender(d) or d.sender diff --git a/frappe/templates/emails/new_message.html b/frappe/templates/emails/new_message.html index b51e7129f4..a4a2ea933d 100644 --- a/frappe/templates/emails/new_message.html +++ b/frappe/templates/emails/new_message.html @@ -2,4 +2,4 @@

You have a new message from: {{ from }}

{{ message }}


-

Login and view in Browser

\ No newline at end of file +

Login and view in Browser

diff --git a/frappe/templates/emails/new_user.html b/frappe/templates/emails/new_user.html index 8c6b099c29..ef46f02dc3 100644 --- a/frappe/templates/emails/new_user.html +++ b/frappe/templates/emails/new_user.html @@ -2,9 +2,9 @@

Dear {{ first_name }}{% if last_name %} {{ last_name}}{% endif %},

A new account has been created for you.

Your login id is: {{ user }} -

Click on the button below to complete your registration and set a new password.

-

Complete Registration

+

Click on the link below to complete your registration and set a new password.

+

Complete Registration


You can also copy-paste this link in your browser {{ link }}

Thank you,
-{{ user_fullname }}

\ No newline at end of file +{{ user_fullname }}

diff --git a/frappe/templates/emails/standard.html b/frappe/templates/emails/standard.html index a8f8ffd4de..d3a719a9b9 100644 --- a/frappe/templates/emails/standard.html +++ b/frappe/templates/emails/standard.html @@ -4,273 +4,16 @@ {{ subject or "" }} - - - -
- - - - - - - -
- - -
- - - - -
- {{ content }} -
-
- - -
- +
{{ content }}
- - - - - - - - -
- - diff --git a/frappe/utils/email_lib/email_body.py b/frappe/utils/email_lib/email_body.py index 0ceecb6f5d..f65d60613f 100644 --- a/frappe/utils/email_lib/email_body.py +++ b/frappe/utils/email_lib/email_body.py @@ -6,13 +6,14 @@ import frappe from frappe import msgprint, throw, _ from frappe.utils import scrub_urls, cstr import email.utils +from markdown2 import markdown + def get_email(recipients, sender='', msg='', subject='[No Subject]', text_content = None, footer=None, print_html=None, formatted=None): """send an html email as multipart with attachments and all""" emailobj = EMail(sender, recipients, subject) - if (not '
' in msg) and (not '

' in msg) and (not '') + msg = markdown(msg) emailobj.set_html(msg, text_content, footer=footer, print_html=print_html, formatted=formatted) return emailobj @@ -189,7 +190,6 @@ class EMail: def get_formatted_html(subject, message, footer=None, print_html=None): # imported here to avoid cyclic import - import inlinestyler.utils message = scrub_urls(message) rendered_email = frappe.get_template("templates/emails/standard.html").render({ @@ -204,7 +204,7 @@ def get_formatted_html(subject, message, footer=None, print_html=None): if frappe.local.flags.in_test: return rendered_email - return cstr(inlinestyler.utils.inline_css(rendered_email)) + return rendered_email def get_footer(footer=None): """append a footer (signature)""" diff --git a/requirements.txt b/requirements.txt index 76e3d85520..c309d80ebd 100644 --- a/requirements.txt +++ b/requirements.txt @@ -16,8 +16,6 @@ slugify termcolor werkzeug semantic_version -lxml -inlinestyler rauth>=0.6.2 requests==1.2.3 celery