• Resolved substa

    (@substa)


    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

    https://www.ads-software.com/extend/plugins/theme-my-login/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Jeff Farthing

    (@jfarthing84)

    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' );
    Thread Starter substa

    (@substa)

    Ok, the function to use is get_userdata, and not get_user, but it works! ??
    Thank you Jeff ??

    Plugin Author Jeff Farthing

    (@jfarthing84)

    Yea, you’re right.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Plugin: Theme My Login] Get email after user activaction’ is closed to new replies.