• Resolved RaymondTri

    (@raymondtri)


    To whom it may concern;

    I am experiencing trouble with my website, https://myhubpos.com.

    When someone goes through the process, an account is created for them, and wp_new_user_notification is triggered, however it only sends e-mails to me, the Admin, and not the newly registered user so they don’t know their password etc.

    Any thoughts?

    https://ww.wp.xz.cn/plugins/chargify/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter RaymondTri

    (@raymondtri)

    Update, after doing more debugging.

    Whenever a user registers for my site through the Chargify plugin, the e-mail containing their password + login information does not get sent to them, but the admin is notified.

    Whenever a user registers for my site through (/wp-login.php?action=register), both e-mails get sent properly, to the admin, as well as the e-mail to the user containing their password etc.

    Thread Starter RaymondTri

    (@raymondtri)

    I figured out the problem, and am now posting the solution for anyone else.

    In the chargify.php file, the bug is located in
    function subscriptionCreate()

    Locate the code section that looks like this

    if(isset($trans['existing_user']) && $trans['existing_user'] == true)
    $user_id = $current_user->ID;
    else
    $user_id = wp_insert_user($args);

    instead of using wp_insert_user we need to use wp_create_user

    Simply change
    $user_id = wp_insert_user($args);
    to
    $user_id = wp_create_user($email, $user_pass, $email);

    I hope this helps anyone else with this problem.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘wp_new_user_notification’ is closed to new replies.