E-Mailtemplate vorbereitet
This commit is contained in:
parent
732744b078
commit
dc8be886e6
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -31,7 +31,7 @@ urlpatterns = [
|
||||||
path('standards/', include('standards.urls'), name="standards"),
|
path('standards/', include('standards.urls'), name="standards"),
|
||||||
path('news/', include('news.urls'), name="dashboard"),
|
path('news/', include('news.urls'), name="dashboard"),
|
||||||
path('orga/', include('orga.urls'), name="orga"),
|
path('orga/', include('orga.urls'), name="orga"),
|
||||||
path('password-reset/', auth_views.PasswordResetView.as_view(template_name='users/password_reset.html'), name='password-reset'),
|
path('password-reset/', auth_views.PasswordResetView.as_view(template_name='users/password_reset.html', html_email_template_name='users/password_reset_mail.html'), name='password-reset'),
|
||||||
path('password-reset/done/', auth_views.PasswordResetDoneView.as_view(template_name='users/password_reset_done.html'), name='password_reset_done'),
|
path('password-reset/done/', auth_views.PasswordResetDoneView.as_view(template_name='users/password_reset_done.html'), name='password_reset_done'),
|
||||||
path('password-reset-confirm/<uidb64>/<token>/', auth_views.PasswordResetConfirmView.as_view(template_name='users/password_reset_confirm.html'), name='password_reset_confirm'),
|
path('password-reset-confirm/<uidb64>/<token>/', auth_views.PasswordResetConfirmView.as_view(template_name='users/password_reset_confirm.html'), name='password_reset_confirm'),
|
||||||
path('password-reset-complete/', auth_views.PasswordResetCompleteView.as_view(template_name='users/password_reset_complete.html'), name='password_reset_complete'),
|
path('password-reset-complete/', auth_views.PasswordResetCompleteView.as_view(template_name='users/password_reset_complete.html'), name='password_reset_complete'),
|
||||||
|
|
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -0,0 +1,26 @@
|
||||||
|
{% load i18n %}{% autoescape off %}
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h3>Digitale Agentur Passwort</h3>
|
||||||
|
<p>
|
||||||
|
Hallo {{user.first_name}} {{user.last_name}},<br />
|
||||||
|
Sie haben eine neues Passwort für den Zugang ihrer Agentur {{user.profile.agency.name}} angefordert. Bitte gehen Sie auf folgenden Link, um sich ein Passwort zu setzen:
|
||||||
|
{% block reset_link %}
|
||||||
|
{{ protocol }}://{{ domain }}{% url 'password_reset_confirm' uidb64=uid token=token %}
|
||||||
|
{% endblock %}
|
||||||
|
Ihr Benutzername: {{ user.get_username }}
|
||||||
|
<br />
|
||||||
|
Sollten Sie kein Passwort angefordert haben, ignorieren Sie diese E-Mail.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
Vielen Dank, dass Sie die Plattform <i>Digitale Agentur</i> nutzen!
|
||||||
|
<br />
|
||||||
|
Mit freundlichen Grüßen
|
||||||
|
<br /><br />
|
||||||
|
Ihr Team von Digitale Agentur
|
||||||
|
</p>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
{% endautoescape %}
|
||||||
|
|
@ -0,0 +1,24 @@
|
||||||
|
{% load i18n %}{% autoescape off %}
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h3>Digitale Agentur Registrierung</h3>
|
||||||
|
<p>
|
||||||
|
Hallo {{username}},<br />
|
||||||
|
Ihre Agentur wurde erstellt. Sie können sich nun <a href="https://digitale-agentur.com">hier anmelden</a> und ihre Agentur gestalten.
|
||||||
|
<br /><br />
|
||||||
|
Ihr Benutzername: {{ username_log }}
|
||||||
|
<br />
|
||||||
|
Sollten Sie kein Passwort angefordert haben, ignorieren Sie diese E-Mail.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
Vielen Dank, dass Sie die Plattform <i>Digitale Agentur</i> nutzen!
|
||||||
|
<br />
|
||||||
|
Mit freundlichen Grüßen
|
||||||
|
<br /><br />
|
||||||
|
Ihr Team von Digitale Agentur
|
||||||
|
</p>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
{% endautoescape %}
|
||||||
|
|
@ -21,6 +21,7 @@ from news.models import News
|
||||||
import requests
|
import requests
|
||||||
import json
|
import json
|
||||||
from PIL import Image
|
from PIL import Image
|
||||||
|
from django.template.loader import render_to_string
|
||||||
'''
|
'''
|
||||||
|
|
||||||
DASHBOARD-View
|
DASHBOARD-View
|
||||||
|
|
@ -42,18 +43,22 @@ class AgencyCreateView(CreateView):
|
||||||
# SAVE OBJECTS TO SIGNALE!
|
# SAVE OBJECTS TO SIGNALE!
|
||||||
agency = Agency()
|
agency = Agency()
|
||||||
agency.save()
|
agency.save()
|
||||||
|
newuser_name = form.cleaned_data.get('first_name') + ' ' + form.cleaned_data.get('last_name')
|
||||||
form.instance.agency = agency
|
form.instance.agency = agency
|
||||||
|
msg_html = render_to_string('users/register_mail.html', {'username': newuser_name})
|
||||||
# E-Mail für Passwort-Setzung!
|
# E-Mail für Passwort-Setzung!
|
||||||
send_mail(
|
send_mail(
|
||||||
'Agenturanmeldung',
|
'Agenturanmeldung',
|
||||||
'Hallo ' + form.cleaned_data.get('first_name') + ' ' + form.cleaned_data.get('last_name') + '! Bitte setzen sie sich auf https://digitale-agentur.com/password-reset/ ein Passwort. Anschließend können Sie weitere Details Ihrer Agentur eingeben.',
|
'Hallo ' + form.cleaned_data.get('first_name') + ' ' + form.cleaned_data.get('last_name') + '! Bitte setzen sie sich auf https://digitale-agentur.com/password-reset/ ein Passwort. Anschließend können Sie weitere Details Ihrer Agentur eingeben.',
|
||||||
'support@digitale-agentur.com',
|
'support@digitale-agentur.com',
|
||||||
[form.cleaned_data.get('email')],
|
[form.cleaned_data.get('email')],
|
||||||
fail_silently=False,
|
html_message=msg_html,
|
||||||
|
fail_silently=False
|
||||||
)
|
)
|
||||||
return super().form_valid(form)
|
return super().form_valid(form)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@login_required
|
@login_required
|
||||||
def dashboard(request):
|
def dashboard(request):
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue