Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ARN
coin
Commits
b9566cff
Commit
b9566cff
authored
Aug 22, 2018
by
ljf
Committed by
jocelyn
Mar 17, 2019
Browse files
[enh] Use utils.send_templated_email
parent
cf04c2f4
Changes
1
Hide whitespace changes
Inline
Side-by-side
coin/members/models.py
View file @
b9566cff
...
...
@@ -68,15 +68,14 @@ def send_registration_notification(sender, user, request=None, **kwargs):
Send a notification to the admin if a user subscribe
"""
relative_link
=
reverse
(
'admin:members_member_change'
,
args
=
[
user
.
id
])
abs_link
=
request
.
build_absolute_uri
(
relative_link
)
send_mail
(
'[COIN] Nouvelle inscription'
,
'Bonjour,
\n
'
+
'%s s
\'
est enregistré(e) sur COIN.
\n
'
%
user
.
username
+
'Lien d
\'
édition: %s'
%
abs_link
,
settings
.
DEFAULT_FROM_EMAIL
,
settings
.
NOTIFICATION_EMAILS
,
fail_silently
=
False
)
edit_link
=
request
.
build_absolute_uri
(
relative_link
)
utils
.
send_templated_email
(
to
=
settings
.
NOTIFICATION_EMAILS
,
subject_template
=
'members/emails/new_member_subject.txt'
,
body_template
=
'members/emails/new_member_email.html'
,
context
=
{
'member'
:
self
,
'edit_link'
:
edit_link
},
**
kwargs
)
class
Member
(
CoinLdapSyncMixin
,
AbstractUser
):
...
...
Write
Preview
Supports
Markdown
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