Commit 32465f9f authored by Adrián Ribao's avatar Adrián Ribao
Browse files

changed the way inline css is generated

parent 87aa874e
......@@ -8,7 +8,8 @@ from django.contrib.staticfiles.finders import find
from django.core.mail import EmailMultiAlternatives
from django.template import Template, Context
from lxml import etree
from premailer import Premailer
#from premailer import Premailer
from inlinestyler.utils import inline_css
from django.conf import settings
from django.core.urlresolvers import reverse
from django.core.signing import Signer
......@@ -46,8 +47,9 @@ class CampaignDeliver(object):
result = etree.tostring(tree.getroot(), pretty_print=True, method="html")
#print result
p = Premailer(result, remove_classes=False, include_star_selectors=True, strip_important=False)
html = p.transform()
#p = Premailer(result, remove_classes=False, include_star_selectors=True, strip_important=False)
#html = p.transform()
html = inline_css(result)
return html
def parse_links(self, tree):
......@@ -78,7 +80,7 @@ class CampaignDeliver(object):
h = html2text.HTML2Text()
#h.ignore_links = True
#h.inline_links = True
text = h.handle(html)
text = h.handle(html.decode('utf-8'))
return text
def send_to_contact(self, contact):
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment