substa
Member
Posted 6 months ago #
Hello,
I'm trying to implement a custom function with
add_action( 'tml_new_user_activated', 'tml_new_user_activated' );
to register the new user to the newsletter...
How can I get the user email immediately after the activation inside "tml_new_user_activated" function?
I thought to use a query to retrieve the email of the last user activated, but I hope there is a better way ;)
Thanks,
Giovanni
http://wordpress.org/extend/plugins/theme-my-login/
The user ID is passed into the callback function. You can obtain the user_email with that.
function tml_new_user_activated( $user_id ) {
$user = get_user( $user_id );
// Access e-mail with $user->user_email
}
add_filter( 'tml_new_user_activated', 'tml_new_user_activated' );
substa
Member
Posted 6 months ago #
Ok, the function to use is get_userdata, and not get_user, but it works! :)
Thank you Jeff ;)