diff options
author | Adam Bogdał <adam@bogdal.pl> | 2015-04-23 09:04:30 +0200 |
---|---|---|
committer | Adam Bogdał <adam@bogdal.pl> | 2015-04-23 09:04:30 +0200 |
commit | 1b481e0c0069880ed66caab244c799d166754faa (patch) | |
tree | cbe34120debb9e797eb84423575e227e4b15c879 /saleor/registration | |
parent | e3e27f775b2b8ac9e5f1fd8034fa1ce793c5c97f (diff) | |
download | saleor-frontend-1b481e0c0069880ed66caab244c799d166754faa.tar.gz saleor-frontend-1b481e0c0069880ed66caab244c799d166754faa.tar.bz2 saleor-frontend-1b481e0c0069880ed66caab244c799d166754faa.zip |
Bump versions and use emailit instead of current solution for the emails
Diffstat (limited to 'saleor/registration')
-rw-r--r-- | saleor/registration/forms.py | 8 | ||||
-rw-r--r-- | saleor/registration/templates/registration/emails/change_email.body.txt (renamed from saleor/registration/templates/registration/emails/change_email.txt) | 4 | ||||
-rw-r--r-- | saleor/registration/templates/registration/emails/change_email.subject.txt | 2 | ||||
-rw-r--r-- | saleor/registration/templates/registration/emails/confirm_email.body.txt (renamed from saleor/registration/templates/registration/emails/confirm_email.txt) | 4 | ||||
-rw-r--r-- | saleor/registration/templates/registration/emails/confirm_email.subject.txt | 2 |
5 files changed, 10 insertions, 10 deletions
diff --git a/saleor/registration/forms.py b/saleor/registration/forms.py index af345e2d..9a87b50d 100644 --- a/saleor/registration/forms.py +++ b/saleor/registration/forms.py @@ -1,5 +1,6 @@ from __future__ import unicode_literals +import emailit.api from django import forms from django.contrib.auth import authenticate, get_user_model from django.contrib.auth.forms import AuthenticationForm, SetPasswordForm @@ -12,7 +13,6 @@ from .models import ( EmailChangeRequest, ExternalUserData) from .utils import get_client_class_for_service -from ..communication.mail import send_email class LoginForm(AuthenticationForm): @@ -48,7 +48,7 @@ class RequestEmailConfirmationForm(forms.Form): email = forms.EmailField() - template = 'registration/emails/confirm_email.txt' + template = 'registration/emails/confirm_email' def __init__(self, local_host=None, data=None): self.local_host = local_host @@ -59,7 +59,7 @@ class RequestEmailConfirmationForm(forms.Form): request = self.create_request_instance() confirmation_url = self.local_host + request.get_confirmation_url() context = {'confirmation_url': confirmation_url} - send_email(email, self.template, context) + emailit.api.send_mail([email], context, self.template) def create_request_instance(self): email = self.cleaned_data['email'] @@ -70,7 +70,7 @@ class RequestEmailConfirmationForm(forms.Form): class RequestEmailChangeForm(RequestEmailConfirmationForm): - template = 'registration/emails/change_email.txt' + template = 'registration/emails/change_email' def __init__(self, user=None, *args, **kwargs): self.user = user diff --git a/saleor/registration/templates/registration/emails/change_email.txt b/saleor/registration/templates/registration/emails/change_email.body.txt index fc277387..70659c9f 100644 --- a/saleor/registration/templates/registration/emails/change_email.txt +++ b/saleor/registration/templates/registration/emails/change_email.body.txt @@ -1,8 +1,6 @@ {% load i18n %} -{% block subject %}{% trans "Confirm your email address" %}{% endblock %} - -{% block text %}{% blocktrans %}Hi! +{% block content %}{% blocktrans %}Hi! You have requested email change in saleor project. To continue visit the link below. diff --git a/saleor/registration/templates/registration/emails/change_email.subject.txt b/saleor/registration/templates/registration/emails/change_email.subject.txt new file mode 100644 index 00000000..31552620 --- /dev/null +++ b/saleor/registration/templates/registration/emails/change_email.subject.txt @@ -0,0 +1,2 @@ +{% load i18n %} +{% trans "Confirm your email address" %}
\ No newline at end of file diff --git a/saleor/registration/templates/registration/emails/confirm_email.txt b/saleor/registration/templates/registration/emails/confirm_email.body.txt index f3c175fc..927540fa 100644 --- a/saleor/registration/templates/registration/emails/confirm_email.txt +++ b/saleor/registration/templates/registration/emails/confirm_email.body.txt @@ -1,8 +1,6 @@ {% load i18n %} -{% block subject %}{% trans "Confirm your email address" %}{% endblock %} - -{% block text %}{% blocktrans %}Hi! +{% block content %}{% blocktrans %}Hi! You have requested login access to saleor project. To continue visit the link below. diff --git a/saleor/registration/templates/registration/emails/confirm_email.subject.txt b/saleor/registration/templates/registration/emails/confirm_email.subject.txt new file mode 100644 index 00000000..31552620 --- /dev/null +++ b/saleor/registration/templates/registration/emails/confirm_email.subject.txt @@ -0,0 +1,2 @@ +{% load i18n %} +{% trans "Confirm your email address" %}
\ No newline at end of file |