Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Remove CustomTemplateBackend with premailer

Anna Siwik6f4e49aaafce
diff --git a/requirements.in b/requirements.in
index 4b909b5286..aee3353fb9 100644
--- a/requirements.in
+++ b/requirements.in
@@ -35,7 +35,6 @@ Markdown>=2.4
maxminddb
maxminddb-geolite2
phonenumberslite>=8.8.8
-premailer>=3.1.1
prices>=0.5.7
psycopg2>=2.6
purl>=0.4.1
diff --git a/requirements.txt b/requirements.txt
index cb896fceec..32ed31a5ea 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -20,8 +20,6 @@ cffi==1.11.4 # via cairocffi, cryptography, weasyprint
chardet==3.0.4 # via requests
cryptography==2.1.4 # via django-payments
cssselect2==0.2.1 # via cairosvg, weasyprint
-cssselect==1.0.3 # via premailer
-cssutils==1.0.2 # via premailer
defusedxml==0.5.0 # via cairosvg, python3-openid, social-auth-core
dj-database-url==0.4.2
dj-email-url==0.0.10
@@ -64,7 +62,6 @@ iso8601==0.1.12 # via graphene-django
jmespath==0.9.3 # via boto3, botocore
jsonfield==2.0.2
kombu==4.1.0 # via celery
-lxml==4.1.1 # via premailer
markdown==2.6.11
maxminddb-geolite2==2017.803
maxminddb==1.3.0
@@ -74,7 +71,6 @@ pdfrw==0.4 # via weasyprint
phonenumberslite==8.8.9
pillow==5.0.0 # via cairosvg, django-versatileimagefield
pluggy==0.6.0 # via pytest
-premailer==3.1.1
prices==0.5.9
promise==2.1 # via graphene, graphene-django, graphql-core, graphql-relay
psycopg2==2.7.3.2
diff --git a/saleor/core/utils/email_backend.py b/saleor/core/utils/email_backend.py
deleted file mode 100644
index 7d46280a68..0000000000
--- a/saleor/core/utils/email_backend.py
+++ /dev/null
@@ -1,18 +0,0 @@
-from premailer import transform
-from templated_email.backends.vanilla_django import TemplateBackend
-
-from django.conf import settings
-from django.contrib.sites.models import Site
-
-
-class CustomTemplateBackend(TemplateBackend):
- def _render_email(self, *args, **kwargs):
- result = super()._render_email(*args, **kwargs)
- html = result.get('html')
- if html:
- site = Site.objects.get_current()
- protocol = 'https' if settings.ENABLE_SSL else 'http'
- base_url = '{}://{}'.format(protocol, site.domain)
- transformed_html = transform(html, base_url=base_url)
- result.update({'html': transformed_html})
- return result