rtissot committed 4ca0b39

add a setting to allow activation emails to be send in copy to the email of your choice.

Comments (0)

Files changed (2)


     is optional, and a default of ``True`` will be assumed if it is
     not supplied.
+   A list of tuples containing the name and address of the people
+   who should receive a copy of every activation mail sent. 
 By default, this backend uses
 :class:`registration.forms.RegistrationForm` as its form class for
 user registration; this can be overridden by passing the keyword


 from django.db import transaction
 from django.template.loader import render_to_string
 from django.utils.translation import ugettext_lazy as _
+from django.core.mail import EmailMessage
     from django.utils.timezone import now as datetime_now
         Send an activation email to the user associated with this
         The activation email will make use of two templates:
             The User object associated with the RegistrationProfile.
         ctx_dict = {'activation_key': self.activation_key,
                     'expiration_days': settings.ACCOUNT_ACTIVATION_DAYS,
         # Email subject *must not* contain newlines
         subject = ''.join(subject.splitlines())
         message = render_to_string('registration/activation_email.txt',
-        self.user.email_user(subject, message, settings.DEFAULT_FROM_EMAIL)
+        bcced = [email for nick, email in getattr(settings, 'ACCOUNT_ACTIVATION_EMAIL_BCC', [])]
+        EmailMessage(subject, message, settings.DEFAULT_FROM_EMAIL, [,], [bcced]).send()