Commit b9566cff authored by ljf's avatar ljf Committed by jocelyn

[enh] Use utils.send_templated_email

parent cf04c2f4
......@@ -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):
......
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