Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Simplify templated e-mails folder structure
Anna Siwik6f268e61c1c3
diff --git a/.gitignore b/.gitignoreindex 8739720352..628711b011 100644--- a/.gitignore+++ b/.gitignore@@ -28,4 +28,4 @@ dist//static//saleor/static/assets/webpack-bundle.json-/templates/templated_email/html/compiled/+/templates/templated_email/compiled/diff --git a/package.json b/package.jsonindex a971bbab41..46f500a3d3 100644--- a/package.json+++ b/package.json@@ -90,6 +90,6 @@"build-assets": "node ./node_modules/webpack/bin/webpack.js -p --progress","heroku-postbuild": "npm run build-assets","start": "UV_THREADPOOL_SIZE=8 node ./node_modules/webpack/bin/webpack.js -d --watch --progress",- "build-emails": "mkdir -p templates/templated_email/html/compiled/ && find templates -name \"*.mjml\" -not -path \"templates/templated_email/html/source/*partials/*\" -not -path \"templates/templated_email/html/source/*shared/*\" -exec ./node_modules/.bin/mjml -l skip {} -o templates/templated_email/html/compiled/ \\;"+ "build-emails": "mkdir -p templates/templated_email/compiled/ && find templates -name \"*.mjml\" -not -path \"templates/templated_email/source/*partials/*\" -not -path \"templates/templated_email/source/*shared/*\" -exec ./node_modules/.bin/mjml -l skip {} -o templates/templated_email/compiled/ \\;"}}diff --git a/saleor/dashboard/emails.py b/saleor/dashboard/emails.pyindex 266c7f6a72..173ac37fde 100644--- a/saleor/dashboard/emails.py+++ b/saleor/dashboard/emails.py@@ -20,7 +20,7 @@ def send_set_password_email(staff):'uid': urlsafe_base64_encode(force_bytes(staff.pk)).decode(),'token': default_token_generator.make_token(staff)}send_templated_mail(- template_name='dashboard/staff/set_password',+ template_name='source/dashboard/staff/set_password',from_email=settings.DEFAULT_FROM_EMAIL,recipient_list=[staff.email],context=ctx)@@ -35,7 +35,7 @@ def send_promote_customer_to_staff_email(staff):'url': build_absolute_uri(reverse('dashboard:index')),'site_name': site.name}send_templated_mail(- template_name='dashboard/staff/promote_customer',+ template_name='source/dashboard/staff/promote_customer',from_email=settings.DEFAULT_FROM_EMAIL,recipient_list=[staff.email],context=ctx)diff --git a/saleor/order/emails.py b/saleor/order/emails.pyindex dd5404a52c..bf0e6e585e 100644--- a/saleor/order/emails.py+++ b/saleor/order/emails.py@@ -3,9 +3,9 @@ from django.conf import settingsfrom django.contrib.sites.models import Sitefrom templated_email import send_templated_mail-CONFIRM_ORDER_TEMPLATE = 'order/confirm_order'-CONFIRM_PAYMENT_TEMPLATE = 'order/payment/confirm_payment'-CONFIRM_NOTE_TEMPLATE = 'order/note/confirm_note'+CONFIRM_ORDER_TEMPLATE = 'source/order/confirm_order'+CONFIRM_PAYMENT_TEMPLATE = 'source/order/payment/confirm_payment'+CONFIRM_NOTE_TEMPLATE = 'source/order/note/confirm_note'def _send_confirmation(email, url, template, context=None):diff --git a/saleor/registration/emails.py b/saleor/registration/emails.pyindex 2be030ca45..c3004617af 100644--- a/saleor/registration/emails.py+++ b/saleor/registration/emails.py@@ -14,7 +14,7 @@ def send_password_reset_email(context, recipient):kwargs={'uidb64': context['uid'], 'token': context['token']}))context['reset_url'] = reset_urlsend_templated_mail(- template_name='account/password_reset',+ template_name='source/account/password_reset',from_email=settings.DEFAULT_FROM_EMAIL,recipient_list=[recipient],context=context)diff --git a/templates/templated_email/account/password_reset.email b/templates/templated_email/source/account/password_reset.emailsimilarity index 92%rename from templates/templated_email/account/password_reset.emailrename to templates/templated_email/source/account/password_reset.emailindex 719e4e284c..46964ee422 100644--- a/templates/templated_email/account/password_reset.email+++ b/templates/templated_email/source/account/password_reset.email@@ -23,5 +23,5 @@ Sincerely,{% endblock %}{% block html %}-{% include 'templated_email/html/compiled/password_reset.html' %}+{% include 'templated_email/compiled/password_reset.html' %}{% endblock %}diff --git a/templates/templated_email/html/source/account/password_reset.mjml b/templates/templated_email/source/account/password_reset.mjmlsimilarity index 100%rename from templates/templated_email/html/source/account/password_reset.mjmlrename to templates/templated_email/source/account/password_reset.mjmldiff --git a/templates/templated_email/dashboard/staff/promote_customer.email b/templates/templated_email/source/dashboard/staff/promote_customer.emailsimilarity index 88%rename from templates/templated_email/dashboard/staff/promote_customer.emailrename to templates/templated_email/source/dashboard/staff/promote_customer.emailindex 8ae8594af7..198cedc9b1 100644--- a/templates/templated_email/dashboard/staff/promote_customer.email+++ b/templates/templated_email/source/dashboard/staff/promote_customer.email@@ -13,5 +13,5 @@ This is an automatically generated email, please do not reply.{% endblock %}{% block html %}-{% include 'templated_email/html/compiled/promote_customer.html' %}+{% include 'templated_email/compiled/promote_customer.html' %}{% endblock %}diff --git a/templates/templated_email/html/source/dashboard/staff/promote_customer.mjml b/templates/templated_email/source/dashboard/staff/promote_customer.mjmlsimilarity index 100%rename from templates/templated_email/html/source/dashboard/staff/promote_customer.mjmlrename to templates/templated_email/source/dashboard/staff/promote_customer.mjmldiff --git a/templates/templated_email/dashboard/staff/set_password.email b/templates/templated_email/source/dashboard/staff/set_password.emailsimilarity index 91%rename from templates/templated_email/dashboard/staff/set_password.emailrename to templates/templated_email/source/dashboard/staff/set_password.emailindex c14ce53145..502733d3e0 100644--- a/templates/templated_email/dashboard/staff/set_password.email+++ b/templates/templated_email/source/dashboard/staff/set_password.email@@ -17,5 +17,5 @@ This is an automatically generated email, please do not reply.{% endblock %}{% block html %}-{% include 'templated_email/html/compiled/set_password.html' %}+{% include 'templated_email/compiled/set_password.html' %}{% endblock %}diff --git a/templates/templated_email/html/source/dashboard/staff/set_password.mjml b/templates/templated_email/source/dashboard/staff/set_password.mjmlsimilarity index 100%rename from templates/templated_email/html/source/dashboard/staff/set_password.mjmlrename to templates/templated_email/source/dashboard/staff/set_password.mjmldiff --git a/templates/templated_email/order/confirm_order.email b/templates/templated_email/source/order/confirm_order.emailsimilarity index 95%rename from templates/templated_email/order/confirm_order.emailrename to templates/templated_email/source/order/confirm_order.emailindex a2e6f093a9..02852b2f68 100644--- a/templates/templated_email/order/confirm_order.email+++ b/templates/templated_email/source/order/confirm_order.email@@ -34,5 +34,5 @@ Sincerely,{% endblock %}{% block html %}-{% include 'templated_email/html/compiled/confirm_order.html' %}+{% include 'templated_email/compiled/confirm_order.html' %}{% endblock %}diff --git a/templates/templated_email/html/source/order/confirm_order.mjml b/templates/templated_email/source/order/confirm_order.mjmlsimilarity index 100%rename from templates/templated_email/html/source/order/confirm_order.mjmlrename to templates/templated_email/source/order/confirm_order.mjmldiff --git a/templates/templated_email/order/note/confirm_note.email b/templates/templated_email/source/order/note/confirm_note.emailsimilarity index 87%rename from templates/templated_email/order/note/confirm_note.emailrename to templates/templated_email/source/order/note/confirm_note.emailindex adc5206e45..fd1dc1cfaf 100644--- a/templates/templated_email/order/note/confirm_note.email+++ b/templates/templated_email/source/order/note/confirm_note.email@@ -19,5 +19,5 @@ Sincerely,{% endblock %}{% block html %}-{% include 'templated_email/html/compiled/confirm_note.html' %}+{% include 'templated_email/compiled/confirm_note.html' %}{% endblock %}diff --git a/templates/templated_email/html/source/order/note/confirm_note.mjml b/templates/templated_email/source/order/note/confirm_note.mjmlsimilarity index 100%rename from templates/templated_email/html/source/order/note/confirm_note.mjmlrename to templates/templated_email/source/order/note/confirm_note.mjmldiff --git a/templates/templated_email/html/source/order/partials/_order_lines.mjml b/templates/templated_email/source/order/partials/_order_lines.mjmlsimilarity index 100%rename from templates/templated_email/html/source/order/partials/_order_lines.mjmlrename to templates/templated_email/source/order/partials/_order_lines.mjmldiff --git a/templates/templated_email/order/payment/confirm_payment.email b/templates/templated_email/source/order/payment/confirm_payment.emailsimilarity index 86%rename from templates/templated_email/order/payment/confirm_payment.emailrename to templates/templated_email/source/order/payment/confirm_payment.emailindex 702156eefb..e46595464c 100644--- a/templates/templated_email/order/payment/confirm_payment.email+++ b/templates/templated_email/source/order/payment/confirm_payment.email@@ -19,5 +19,5 @@ Sincerely,{% endblock %}{% block html %}-{% include 'templated_email/html/compiled/confirm_payment.html' %}+{% include 'templated_email/compiled/confirm_payment.html' %}{% endblock %}diff --git a/templates/templated_email/html/source/order/payment/confirm_payment.mjml b/templates/templated_email/source/order/payment/confirm_payment.mjmlsimilarity index 100%rename from templates/templated_email/html/source/order/payment/confirm_payment.mjmlrename to templates/templated_email/source/order/payment/confirm_payment.mjmldiff --git a/templates/templated_email/html/source/shared/footer.mjml b/templates/templated_email/source/shared/footer.mjmlsimilarity index 100%rename from templates/templated_email/html/source/shared/footer.mjmlrename to templates/templated_email/source/shared/footer.mjmldiff --git a/templates/templated_email/html/source/shared/header.mjml b/templates/templated_email/source/shared/header.mjmlsimilarity index 100%rename from templates/templated_email/html/source/shared/header.mjmlrename to templates/templated_email/source/shared/header.mjmldiff --git a/templates/templated_email/html/source/shared/styles.mjml b/templates/templated_email/source/shared/styles.mjmlsimilarity index 100%rename from templates/templated_email/html/source/shared/styles.mjmlrename to templates/templated_email/source/shared/styles.mjmldiff --git a/tests/dashboard/test_staff.py b/tests/dashboard/test_staff.pyindex ceed5419f6..afba112ef9 100644--- a/tests/dashboard/test_staff.py+++ b/tests/dashboard/test_staff.py@@ -97,7 +97,7 @@ def test_send_set_password_email(staff_user):'uid': urlsafe_base64_encode(force_bytes(staff_user.pk)).decode(),'token': default_token_generator.make_token(staff_user)}send_templated_mail(- template_name='dashboard/staff/set_password',+ template_name='source/dashboard/staff/set_password',from_email=DEFAULT_FROM_EMAIL,recipient_list=[staff_user.email],context=ctx)