Unverified Commit a17c893e authored by Thom Wiggers's avatar Thom Wiggers 📐

Create user form with welcome mail

parent 6eeead71
......@@ -42,7 +42,11 @@ class UserCreationForm(forms.ModelForm):
if commit:
user.save()
if self.cleaned_data['send_welcome_email']:
with translation.override(user.member.language):
# Ugly way to get the language since member isn't available
language = str(self.data.get('member-0-language', 'en'))
if language not in ('nl', 'en'):
language = 'en'
with translation.override(language):
email_body = loader.render_to_string(
'members/email/welcome.txt',
{'user': user, 'password': password})
......
{% load i18n %}
{% blocktrans %}Dear {{ user.get_full_name }},
{% load i18n %}{% blocktrans trimmed %}Dear {{ user.get_full_name }},
Welcome to Study Association Thalia! You now have an account and can
log in at https://thalia.nu/. Make sure to check the information in
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment