[Fixed]-Can Mezzanine send an email to admin when a user signs up?

1👍

For the sake of closure, here is the solution I was more or less handed from Steve MacDonald himself on the mezzanine-users mailing list. The setting ACCOUNTS_PROFILE_FORM_CLASS allows one to specify a custom form class for user profile signup/update. So, in settings.py set:

ACCOUNTS_PROFILE_FORM_CLASS = "myapp.forms.MyCustomProfileForm"

And in myapp.forms.py send the email on save:

from mezzanine.accounts.forms import ProfileForm

class MyCustomProfileForm(ProfileForm):
    def save(self, *args, **kwargs):
        user = super(MyCustomProfileForm, self).save(*args, **kwargs)
        if self._signup:
            # send email here
        return user

This worked very well for me.

👤xnx

Leave a comment