In the system I am building user CAN NOT register them selves. The users are added by one of the system admins. So there is no user registration form or view. The registration is only being done in the admin so I guess that the send_mail has to be over there also (or am I wrong)?
I need to send an automatic email to the user when he/she is being created and only then (not on every save of the model).
Can any one help with this? Is there a built-in something for that? or how do I do that?
I’ve read about the create_user user Manager, but I thought there is a better way then editing a manager.
You can register a callback on the post_save signal for the User model. Somewhere along the lines of:
Note the
if kwargs["created"]:condition which checks if this is a newly created User instance.