Apply premailer to emails sent using Emailer
This commit is contained in:
parent
9430c4cf98
commit
9ff988d2e9
@ -22,6 +22,7 @@ from django.conf import settings
|
|||||||
from django.template import loader
|
from django.template import loader
|
||||||
from jinja2 import Markup
|
from jinja2 import Markup
|
||||||
|
|
||||||
|
import logging
|
||||||
import markdown
|
import markdown
|
||||||
|
|
||||||
# Debugging
|
# Debugging
|
||||||
@ -90,6 +91,8 @@ class Emailer:
|
|||||||
content_markdown = self.markdown(content_txt)
|
content_markdown = self.markdown(content_txt)
|
||||||
content_html = self.template.render({'email_content': Markup(content_markdown)})
|
content_html = self.template.render({'email_content': Markup(content_markdown)})
|
||||||
|
|
||||||
|
content_html = premailer.Premailer(content_html, cssutils_logging_level=logging.ERROR, strip_important=False).transform()
|
||||||
|
|
||||||
return content_txt, content_html
|
return content_txt, content_html
|
||||||
|
|
||||||
def send_mail(self, recipients, subject, template_loc, params):
|
def send_mail(self, recipients, subject, template_loc, params):
|
||||||
|
Loading…
Reference in New Issue
Block a user