• Resolved stramato

    (@stramato)


    I have an external react-native app that logs in through this plugin. It does get a jwt just fine.

    I also have the checkbox for ‘simple_jwt_login_login_hook’ checked.

    add_action('simple_jwt_login_login_hook', 'my_test');
    function my_test() {
        //...$to.. $subject.. $message.. $headers
        wp_mail($to,$subject,$message,$headers);
    }

    However, after logging in on my app, WordPress seems to be not doing anything? Is there something that I’m missing?

Viewing 1 replies (of 1 total)
  • Plugin Author Nicu Micle

    (@nicu_m)

    Hello @stramato,

    Your function does not have any parameters..

    Here is a simple example:

    
    add_action('simple_jwt_login_login_hook', 'my_test');
    
    function my_test($user) {
        $to = $user->user_email;
        $subject = 'test';
        $message = 'test';
        $headers = null;
    
        wp_mail($to,$subject,$message,$headers);
    }
    

    For more examples, you can check the documentation page: https://simplejwtlogin.com/docs/hooks#code-examples

    Best regards,
    Nicu.

Viewing 1 replies (of 1 total)
  • The topic ‘hook not firing’ is closed to new replies.