Skip to content

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

Add MJML template for password reset

Anna Siwik7d0a29a39859
diff --git a/saleor/registration/views.py b/saleor/registration/views.py
index cf03197270..8b5967415c 100644
--- a/saleor/registration/views.py
+++ b/saleor/registration/views.py
@@ -14,7 +14,8 @@ from .forms import LoginForm, PasswordSetUpForm, SignupForm
@find_and_assign_anonymous_cart()
def login(request):
kwargs = {
- 'template_name': 'account/login.html', 'authentication_form': LoginForm}
+ 'template_name': 'account/login.html',
+ 'authentication_form': LoginForm}
return django_views.LoginView.as_view(**kwargs)(request, **kwargs)
diff --git a/templates/account/email/password_reset_message.txt b/templates/account/email/password_reset_message.txt
deleted file mode 100644
index 30f820ab80..0000000000
--- a/templates/account/email/password_reset_message.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-{% load i18n %}{% blocktrans %}Hello from {{ site_name }}!
-
-You're receiving this e-mail because you or someone else has requested a password for your user account at {{ domain }}.
-It can be safely ignored if you did not request a password reset. Click the link below to reset your password.{% endblocktrans %}
-
-{{ protocol}}://{{ domain }}{% url 'account_reset_password_confirm' uidb64=uid token=token %}
-
-{% blocktrans %}Thank you for using {{ site_name }}!
-{{ domain }}{% endblocktrans %}
\ No newline at end of file
diff --git a/templates/account/email/password_reset_subject.txt b/templates/account/email/password_reset_subject.txt
deleted file mode 100644
index aa80d11443..0000000000
--- a/templates/account/email/password_reset_subject.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-{% load i18n %}
-{% autoescape off %}
-{% blocktrans %}Password Reset E-mail{% endblocktrans %}
-{% endautoescape %}
\ No newline at end of file
diff --git a/templates/templated_email/account/password_reset.email b/templates/templated_email/account/password_reset.email
new file mode 100644
index 0000000000..719e4e284c
--- /dev/null
+++ b/templates/templated_email/account/password_reset.email
@@ -0,0 +1,27 @@
+{% load i18n %}
+
+{% block subject %}
+ {% trans "Password reset e-mail" context "Password reset e-mail subject" %}
+{% endblock %}
+
+{% block plain %}
+{% blocktrans context "Password reset e-mail text" %}
+Hi!
+
+You're receiving this e-mail because you or someone else has requested a password for your user account at {{ domain }}.
+It can be safely ignored if you did not request a password reset. Click the link below to reset your password.
+{% endblocktrans %}
+
+{{ protocol}}://{{ domain }}{% url 'account_reset_password_confirm' uidb64=uid token=token %}
+
+This is an automatically generated email, please do not reply.
+
+{% blocktrans context "Password reset e-mail text" %}
+Sincerely,
+{{ site_name }}
+{% endblocktrans %}
+{% endblock %}
+
+{% block html %}
+{% include 'templated_email/html/compiled/password_reset.html' %}
+{% endblock %}
diff --git a/templates/templated_email/html/source/account/password_reset.mjml b/templates/templated_email/html/source/account/password_reset.mjml
new file mode 100644
index 0000000000..2bbab591ea
--- /dev/null
+++ b/templates/templated_email/html/source/account/password_reset.mjml
@@ -0,0 +1,36 @@
+<mjml>
+ <mj-head>
+ <mj-include path="../shared/styles" />
+ </mj-head>
+ <mj-body>
+ <mj-container>
+ <mj-section css-class="no-display">
+ <mj-column>
+ <mj-text>
+ {% load i18n %}
+ </mj-text>
+ </mj-column>
+ </mj-section>
+ <mj-include path="../shared/header" />
+ <mj-section>
+ <mj-column>
+ <mj-text font-size="16px">
+ {% trans "Hi!" context "Password reset e-mail text" %}
+ </mj-text>
+ <mj-text>
+ {% blocktrans trimmed context "Password reset e-mail text" %}
+ You're receiving this e-mail because you or someone else has requested a password for your user account at {{ domain }}.<br/>
+ It can be safely ignored if you did not request a password reset. Click the link below to reset your password.
+ {% endblocktrans %}
+ </mj-text>
+ <mj-text>
+ <a href="{{ protocol}}://{{ domain }}{% url 'account_reset_password_confirm' uidb64=uid token=token %}">
+ {{ protocol}}://{{ domain }}{% url 'account_reset_password_confirm' uidb64=uid token=token %}
+ </a>
+ </mj-text>
+ </mj-column>
+ </mj-section>
+ <mj-include path="../shared/footer" />
+ </mj-container>
+ </mj-body>
+</mjml>