solved New SignUp Listener

SoftDesigns
SoftDesigns
@softdesigns
7 years ago
242 posts
How can we hook into an event or listener, to add custom code, when a New User SignsUp ?
--
NOTE - We are using the OneAll module

updated by @softdesigns: 03/13/18 11:43:36AM
michael
@michael
7 years ago
7,694 posts
If you look in the jrUser module's _init() function you'll see the events it fires. The ones you're probably interested in are:
    // register our triggers
    jrCore_register_event_trigger('jrUser', 'signup_validate', 'Fired when a user submits account data for a new account');
    jrCore_register_event_trigger('jrUser', 'signup_created', 'Fired when a user successfully signs up for a new account');
    jrCore_register_event_trigger('jrUser', 'signup_activated', 'Fired when a user successfully validates their account');
    jrCore_register_event_trigger('jrUser', 'login_success', 'Fired when a user successfully logs in');
......

Pick one of those that suits where you want to interact with the flow and define a listener in your module, then when the event fires you can do your stuff.

Docs: "Events and Listeners"
https://www.jamroom.net/the-jamroom-network/documentation/module-developer-guide/1011/events-and-listeners
SoftDesigns
SoftDesigns
@softdesigns
7 years ago
242 posts
@michael - Many Thanks - Need more time to study this...
--
We have done this long ago, but need memory refresher - haha
--
Great Support :)
updated by @softdesigns: 12/11/17 04:26:56PM
michael
@michael
7 years ago
7,694 posts
Its easy. you just need to figure out where you want to interact with the data. See the explanations for details.

'signup_validate' is when the form is submitted, but before the account has been created, 'signup_created' is when the form looks ok, but the user hasnt confirmed their email address, 'signup_activated' is when they confirm their email address, then 'login_success' is when they login. If you want to know if its the FIRST time they have logged in, query the database for last login time and if its blank you know its their first time, so do what you need to do.
SoftDesigns
SoftDesigns
@softdesigns
7 years ago
242 posts
@michael - Many Thanks - Now have this working in custom module.
--
Great Support :) - Solved...

Tags