From c4ce0c869b2f57a65eb06e1d27b828354b3175ec Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Mon, 27 Jan 2014 14:55:52 +0530 Subject: [PATCH] Added requirement: inlinestyler, added html email template, expand partial links in bulk email text content --- requirements.txt | 1 + webnotes/templates/emails/__init__.py | 0 .../templates/emails/html_email_template.html | 228 ++++++++++++++++++ webnotes/utils/email_lib/bulk.py | 2 + 4 files changed, 231 insertions(+) create mode 100644 webnotes/templates/emails/__init__.py create mode 100644 webnotes/templates/emails/html_email_template.html diff --git a/requirements.txt b/requirements.txt index 3706262d7b..6ee540199c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -18,3 +18,4 @@ slugify termcolor werkzeug semantic_version +inlinestyler diff --git a/webnotes/templates/emails/__init__.py b/webnotes/templates/emails/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/webnotes/templates/emails/html_email_template.html b/webnotes/templates/emails/html_email_template.html new file mode 100644 index 0000000000..8a7220842a --- /dev/null +++ b/webnotes/templates/emails/html_email_template.html @@ -0,0 +1,228 @@ + + + + + +{{ subject }} + + + + + + + + + + + + +
+ + +
+ + + + +
+ {{ content }} +
+
+ + +
+ + + + + + + + + + + + + + \ No newline at end of file diff --git a/webnotes/utils/email_lib/bulk.py b/webnotes/utils/email_lib/bulk.py index d9eb0facdd..a2521eb623 100644 --- a/webnotes/utils/email_lib/bulk.py +++ b/webnotes/utils/email_lib/bulk.py @@ -55,8 +55,10 @@ def send(recipients=None, sender=None, doctype='Profile', email_field='email', import HTMLParser from webnotes.utils.email_lib.html2text import html2text + from webnotes.utils import expand_partial_links try: + message = expand_partial_links(message) text_content = html2text(message) except HTMLParser.HTMLParseError: text_content = "[See html attachment]"