Support » Plugin: WP REST User » User Register add_action does not fire

  • Resolved careerbuggy

    (@careerbuggy)


    I installed this plugin to create users from the android app. User is getting registered with user role ‘customer’, I have set up to send a couple of emails when a new user gets registered like welcome email, activate or verify email from WooCommerce. With this plugin, none of the emails going out when a new user is getting registered from the Android app. So I tried to write code in the given filter ‘wp_rest_user_user_register’ but this action filer does not fire when the new user registered. If anyone tried let me know.

    add_action(‘wp_rest_user_user_register’, ‘user_registered’);
    function user_registered($user) {
    // Do Something
    }

Viewing 5 replies - 1 through 5 (of 5 total)
  • You should call “wp_send_new_user_notifications” to trigger email notifications related to the creation of new users:

    add_action( 'wp_rest_user_user_register', 'user_registered' );
    function user_registered( $user ) {
        wp_send_new_user_notifications( $user->ID );
    }
    Plugin Author sk8tech

    (@sk8tech)

    Thank you @loureirorg

    trianglestream

    (@trianglestream)

    Hi all,

    First of all thank you for this plugin!

    I have the same problem as @careerbuggy.
    Unfortunately I’m not a PHP expert but I’m trying to add the call mentioned by @loureirorg.

    Which file needs to be edited? Must the lines be written inside a specific function?

    Thank you very much!

    Marco.

    @trianglestream

    1. Go to:
    Admin > Appearance > Theme Editor

    2. Select Theme functions on the list at the right

    3. Paste the code on the editor, after the <?php tag line.

    4. Click “Update file”

    Alternatively, you can access the same file (functions.php) through FTP or SSH.

    trianglestream

    (@trianglestream)

    Thank you for your super-fast response! I’ll try and update.

    UPDATE:
    Yes it works! Now I only need to edit the default registration email.

    Thank you!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘User Register add_action does not fire’ is closed to new replies.