diff --git a/aleksis/apps/paweljong/templates/templated_email/account_registered.email b/aleksis/apps/paweljong/templates/templated_email/account_registered.email new file mode 100644 index 0000000000000000000000000000000000000000..1d1cf04faec6c5baa97ca2fce6f3402af3057c0f --- /dev/null +++ b/aleksis/apps/paweljong/templates/templated_email/account_registered.email @@ -0,0 +1,64 @@ +{% load i18n %} + +{% block subject %} {% trans "New account" %} {{ person }} {% endblock %} + +{% block plain %} + {% blocktrans with new_event=new_event %}New account: {{ person }}{% endblocktrans %} + + **** {% trans "Person" %} **** + + * {% trans "Name" %}: {{ person }} + * {% trans "Username" %} {{ person.user.username }} + * {% trans "Date of birth" %}: {{ person.date_of_birth }} + * {% trans "Email address" %}: {{ person.email }} + * {% trans "Mobile number" %}: {{ person.mobile_number }} + * {% trans "Street" %}: {{ person.street }} + * {% trans "Housenumber" %}: {{ person.housenumber }} + * {% trans "Postal code" %}: {{ person.postal_code }} + * {% trans "Place" %}: {{ person.place }} + + + {% if person.guardians.first %} + **** {% trans "Guardian" %} **** + + * {% trans "Name" %}: {{ person.guardians.first }} + * {% trans "Email address" %}: {{ person.guardians.first.email }} + * {% trans "Mobile number" %}: {{ person.guardians.first.mobile_number }} + {% endif %} + + + {% trans "Your AlekSIS team" %} +{% endblock %} + +{% block html %} +<main> + <p>{% trans "New account": %} {{ person }}</p> + + <blockquote> + <h5>{% trans "Person" %}</h5> + <ul> + <li>{% trans "Name" %}: {{ person }}</li> + <li>{% trans "Username" %}: {{ person.user.username }}</li> + <li>{% trans "Date of birth" %}: {{ person.date_of_birth }}</li> + <li>{% trans "Email address" %}: {{ person.email }}</li> + <li>{% trans "Mobile number" %}: {{ person.mobile_number }}</li> + <li>{% trans "Street" %}: {{ person.street }}</li> + <li>{% trans "Housenumber" %}: {{ person.housenumber }}</li> + <li>{% trans "Postal code" %}: {{ person.postal_code }}</li> + <li>{% trans "Place" %}: {{ person.place }}</li> + </ul> + {% end person.guardians.first %} + <h5>{% trans "Guardian" %}</h5> + <ul> + <li>{% trans "Name" %}: {{ person.guardians.first }}</li> + <li>{% trans "Email address" %}: {{ person.guardians.first.email }}</li> + <li>{% trans "Mobile number" %}: {{ person.guardians.first.mobile_number }}</li> + </ul> + {% endif %} + </blockquote> + + <p> + <i>{% trans "Your AlekSIS team" %}</i> + </p> +</main> +{% endblock %} diff --git a/aleksis/apps/paweljong/views.py b/aleksis/apps/paweljong/views.py index d30369ffcce96b4e3246a1e49dda963a4e09590b..3ef8ca8a50147bb18de06296216a770da7571277 100644 --- a/aleksis/apps/paweljong/views.py +++ b/aleksis/apps/paweljong/views.py @@ -335,6 +335,7 @@ class AccountRegisterWizardView(SessionWizardView): def done(self, form_list, **kwargs): + context = {} cleaned_data_email = self.get_cleaned_data_for_step("email") cleaned_data_register = self.get_cleaned_data_for_step("register") @@ -366,6 +367,21 @@ class AccountRegisterWizardView(SessionWizardView): }, ) + context["person"] = person + + send_templated_mail( + template_name="account_registered", + from_email=get_site_preferences()["mail__address"], + recipient_list='root@teckids.org', + headers={ + "reply_to": [ + person.email, + ], + "X-Zammad-Customer-Email": person.email, + }, + context=context, + ) + return redirect("index")