The MU forums have moved to WordPress.org

disabling signup/welcome notifications (4 posts)

  1. nadaoneal
    Member
    Posted 14 years ago #

    This is maybe just to share, for someone stuck googling for a quick and dirty solution. However, if you have any suggestions, particularly less dirty but equally quick solutions, I'm all ears.

    I wanted to disable all user welcome/signup emails, because I had a plugin doing auto-provisioning after a user logged in through a CAS-like interface. (Particularly, their passwords aren't stored locally in WP, so the email was confusing at best.) I wasn't able to find a quick/easy way to do so. However, this works:

    Create a php file in the mu-plugins folder. It need only contain:

    function wind_return_false() { return false; }
    add_filter( 'wpmu_signup_user_notification', 'wind_return_false', 11, 0 );
    add_filter( 'wpmu_welcome_user_notification', 'wind_return_false',11,0);
    add_filter( 'wpmu_welcome_notification', 'wind_return_false',11,0);
    add_filter( 'wpmu_signup_blog_notification', 'wind_return_false',11,0);

    ... or, obviously, append this to the end of your own auto-provisioning plugin.

    Hope this helps someone. Again, please comment if I'm doing something particularly unwise.

  2. DeannaS
    Member
    Posted 14 years ago #

    You know, instead of just returning false, you can also use those same hooks to send more relevant information. That's what the ldap plugin does - so you can send info about using your ldap credentials instead of a local user account.

  3. nadaoneal
    Member
    Posted 14 years ago #

    Thanks, that's a good point, and I think other people will find it helpful. In our case, we have other documentation and other emails related to signup, so we wanted to totally mute the signup email chatter from WordPress.

  4. nadaoneal
    Member
    Posted 14 years ago #

    Addendum for posterity - there's also wp_new_user_notification in wp-includes/pluggable.php, which sends a username and password you create a user by hand. I should have mentioned in my original post that you can find the wpmu_ functions referenced above in wp-includes/wpmu-functions.php.

    Again as Deanna says you can also overwrite these functions with something that sends an informative email, if you'd like, taking the existing functions as a model.

About this Topic

  • Started 14 years ago by nadaoneal
  • Latest reply from nadaoneal