Batch Create User Email Wrong LInk

I need to create several hundred users and ran a test. The user was added to the correct site, password generated all good. Problem is in the notification email it sent (to me) the link to login was to the main network site and NOT to the sub-site on the network that the user was added to. Why is this, and is there a way to fix?
Thanks.

  • Vinod Dalvi
    • WP Unicorn

    Hi @Ryan,

    Thanks for posting on the forums.

    Could you please share me the notification email you are getting?

    Have you added correct Sitename in the batch create file?

    Can you please send me your batch create file to test if you can?
    - Send an email using our secure contact form on https://premium.wpmudev.org/contact/
    - Select "I have a different question" from the dropdown
    - On the subject enter "Attn: Vinod Dalvi".
    - Include the URL of this post in your message so that I may track this issue better
    - Attach your batch create file

    Kind Regards,
    Vinod Dalvi

  • Hoang Ngo
    • Code Slayer

    Hi @Rya,

    I hope you are well today.

    I need to create several hundred users and ran a test. The user was added to the correct site, password generated all good. Problem is in the notification email it sent (to me) the link to login was to the main network site and NOT to the sub-site on the network that the user was added to. Why is this, and is there a way to fix?

    This is not a bug, and this is the default wordpress behavior for manager. We can modify the link url in the email by the filter called "wpmu_signup_user_notification_email", something like:

    function change_actvate_url($message,$user,$user_email,$key,$meta){
    return str_replace(site_url( "wp-activate.php?key=$key" ),//your new url,$message);
    }
    add_filter('wpmu_signup_user_notification_email','change_actvate_url',10,5)

    But because the default behavior, when user click on register link, it will automate redirect the user to network home site, so we can not track the sub site. I think we can use the referrer url, but this is very unstable so i don't include.

    Best Regards
    Hoang

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.