Hello,
successfully I created the extended modxUser analog the tutorial in rtfm, with three additional tables. Also I can write into my tables when a user is logged in.
But how do I write data into my new tables, during registration, eg. with the Login-Component?
I guess the bestway is to use a posthook, but how to identify the new user id and write the data to my tables?
Thanks for your help.
Greetings
Florian
-
☆ A M B ☆
- 24,524 Posts
The Register snippet will provide some objects for its post-hooks
// A reference to the modUser object
$user = $hook->getValue('register.user');
// A reference to the modUserProfile object
$profile = $hook->getValue('register.profile');
// An array of usergroup names that the User joined
$usergroups = $hook->getValue('register.usergroups');
http://rtfm.modx.com/extras/revo/login/login.tutorials/login.using-pre-and-post-hooks
-
☆ A M B ☆
- 24,524 Posts
Apparently you can also use the user's fields...
$message = 'Hi, a new User signed up: '.$hook->getValue('username')
. ' with email '.$hook->getValue('email').'.';
Hi Susan,
thanks, that is it, where I am looking for...
Have a nice day
Greetings
Florian