Refactored user registration mail listener and event trigger