Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
thalia
concrexit
Commits
a17c893e
Unverified
Commit
a17c893e
authored
Oct 05, 2016
by
Thom Wiggers
📐
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Create user form with welcome mail
parent
6eeead71
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
3 deletions
+6
-3
website/members/forms.py
website/members/forms.py
+5
-1
website/members/templates/members/email/welcome.txt
website/members/templates/members/email/welcome.txt
+1
-2
No files found.
website/members/forms.py
View file @
a17c893e
...
...
@@ -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
})
...
...
website/members/templates/members/email/welcome.txt
View file @
a17c893e
{% 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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment