• Skip to primary navigation
  • Skip to main content

RocketGeek

Home of WP-Members, The Original WordPress Membership Plugin

  • WordPress Plugins
    • WP-Members
      • FAQs
      • Quick Start
      • Documentation
      • Extensions
    • Advanced Options
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • Download Protect
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • Invite Codes
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • MailChimp Integration
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • PayPal Subscriptions
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • Salesforce Web-to-Lead
    • Security
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • Text Editor
      • Purchase the Plugin
      • Get the Pro Bundle
    • User List
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • User Tracking
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • Memberships for WooCommerce
    • WordPass
  • Store
    • Cart
    • Checkout
  • Blog
    • Basics [Free]
    • Tips and Tricks
    • Filters
    • Actions
    • Code Snippets
    • Shortcodes
    • Design
    • Release Announcements
  • Contact
  • Sign In
  • Show Search
Hide Search
Home » Tips and Tricks » Change the WordPress new user registration email to use the WP-Members email

Change the WordPress new user registration email to use the WP-Members email

Chad Butler · Mar 27, 2012 ·

This is a script that will allow you to set up a plugin to change the native WordPress new user registration email (the one that comes from WordPress when a new user is registered) to use the WP-Members new user registration email.

This article is only available to WP-Members Support Subscribers. If you have an existing subscription, please login below. If you do not have a current support subscription, you can purchase a support subscription here.

Already a Member? Log In Here
   
Forgot password? Click here to reset

To gain full access to WP-Members premium content, a current support subscription is required. You can purchase an annual support subscription for as little as $59, which provides you with access to priority support, a customer support forum, access to code snippets, and more.

Why wait? Choose your subscription option here.

[
Why join?]

Tips and Tricks email, tips, wp_new_user_notification

Welcome to RocketGeek Interactive › Forums › Change the WordPress new user registration email to use the WP-Members email

Tagged: email, tips, wp_new_user_notification

  • This topic has 18 replies, 7 voices, and was last updated 1 year ago by Chad Butler.
Viewing 10 reply threads
  • Author
    Posts
    • May 4, 2012 at 1:10 pm #530
      Chad Butler
      Keymaster

      This is a script that will allow you to change the native WordPress new user registration email (the one that comes from WordPress when a new user is
      [See the full post at: Change the WordPress new user registration email to use the WP-Members email]

    • February 10, 2013 at 12:52 am #1996
      wamss
      Participant

      Sorry, but where do I implement this script?

      Thanks

    • February 10, 2013 at 7:11 am #2002
      Chad Butler
      Keymaster

      Great question – it needs to be saved as a .php file, loaded to your plugins folder, then activated as a plugin.

    • October 29, 2013 at 1:30 pm #3261
      ftanaka
      Participant

      Exactly what I need, but the custom wp_new_user_notification never gets called according to the error_log I threw in there, and according to the generic WordPress email I get when I create a member through the dashboard. It’s already defined in pluggable.php in WordPress, but I thought this was only for activation.

      I have it in a functions.php that’s a child theme of twentytwelve. I know the rest of that functions.php is called because it loads custom Javascripts that are getting loaded, and if I leave off the if ( ! function_exists( ‘wp_new_user_notification’ ) ), I get a function-already-declared error in the error_log.

    • October 29, 2013 at 2:39 pm #3264
      ftanaka
      Participant

      I have it working now, but it seems to have to be in a plugin. Apparently the load order is plugins, then pluggable, then theme files. So in functions.php, it sees pluggable’s already defined the function, and it bails. But in a plugin, it goes in, and then pluggable’s version bails. Tested it, and now it works. I read about this load order here.

    • October 29, 2013 at 4:55 pm #3266
      Chad Butler
      Keymaster

      Glad you got it working – hopefully the way you want it.

      Thanks for posting that – it’s quite helpful!

      • January 7, 2015 at 9:51 pm #6761
        ryoung
        Participant

        I have just tried implementing this code snippet in the same way as ftanaka with the same result, ie I inserted snippet into my child theme functions.php and it isn’t working.I infer from what ftanaka says the code snippet actually needs to be implemented as a plugin for it to work. But I am not a developer and dont know how to write my own plugins.
        So how do I proceed?
        Is it planned for this code to become a WP-members extension that I can install?
        Or is there another solution I haven’t been able to locate?
        I need this because ALL new members to my site are created by the WP “add new user” interface and it would be so good to be able to use the “Send this password to the new user by email.” option to welcome my new users with a site specific customized email.
        Thanks

        • January 7, 2015 at 10:41 pm #6769
          Chad Butler
          Keymaster

          I’ve modified the post instructions and the script to be more exact about what to do to load it as a plugin. Hope that helps.

          • January 8, 2015 at 12:08 am #6771
            ryoung
            Participant

            It helps a lot. All working now
            thank you

    • October 18, 2014 at 1:04 pm #6154
      amca
      Participant

      Is it possible to send an email to a different mail depending on what the user fill out on the registration page? For example if user click a check box, the mail will be sent to a different mail address?

      Thanks

      • October 18, 2014 at 2:57 pm #6155
        Chad Butler
        Keymaster

        I would think that is possible. I assume you are talking about admin notification emails?

        The wpmem_notify_addr filter hook allows you to change the admin notification email address. While it only passes the address through the filter, when it fires, the form data is still available in the $_POST object, so you could build in some logic to your function based on whatever fields you wanted. Something like:

        add_filter( 'wpmem_notify_addr', 'my_notify_addr' );
        function my_notify_addr( $email ){
        
        	if( $_POST['some-field'] == 'some-value' ) {
        	
        		$email = 'one@email.com';
        		
        	} else {
        	
        		$email = 'two@email.com';
        		
        	}
        	
        	return $email;
        
        }
    • October 18, 2014 at 3:47 pm #6157
      amca
      Participant

      Great I will give it a shot. Thanks for the fast replay

    • November 12, 2016 at 10:59 am #11709
      whitenoise
      Participant

      Hi Chad, can this still be used with the latest edition of wordpress? At the moment I am registering users myself direct through the admin interface, so this would be perfect.

      Thanks.

      • November 12, 2016 at 11:40 am #11711
        Chad Butler
        Keymaster

        Yes – it’s compatible. The one things that’s different from a lot of other code snippets is that this needs to be installed like a plugin. Save it as a php file then load it to your /wp-content/plugins/ directory. It will override the new user registration email.

        I thought I had done a post since this that worked on it as a filter, and I thought I had added that to the Advanced Options extension, but it appears I may not have completed it as I can’t actually find anything on it in my notes or code snippet library. But that’s off the point really – the answer is yes, this is compatible with current WP.

        • November 12, 2016 at 12:32 pm #11712
          whitenoise
          Participant

          Thanks Chad, I’ve put this into a .php file and activated it as a plugin. Having it as an advanced option would be a good idea, as it keeps it nice and neat and avoids having too many plugins.

          I can’t seem to get it to work though. I’ve created a new user, and used the test email feature to send me a new user registration test email as well. So far nothing after a number of hours. I shall check later, but emails haven’t taken this long before.

          In my advanced options I have

          checked – Disable WP Password Changed Notification
          checked – Disable WP Email Changed Notification
          not checked – Disable WP New User Notification

          In options I have:

          not checked – Notify admin
          not checked – Moderate registration

          I did have another plugin controlling what emails were being sent out, but I removed this. Do you know why nothing is being sent?

          Thanks.

          • November 13, 2016 at 6:34 am #11716
            whitenoise
            Participant

            It looks like the emails have come through now ok, there was just a longer delay than normal. Sorry to bother you.

          • November 13, 2016 at 8:39 pm #11721
            Chad Butler
            Keymaster

            No bother at all!! Glad to hear things are working!

    • February 17, 2020 at 7:15 pm #26085
      dgrinberg
      Participant

      Hey Chad,

      Just wondering if there has been an updated method to do this with the latest versions of WP-members.

      It seems that the function “wpmem_inc_regemail” is now in the “deprecated” file.

      Is there are updated code for this plugin, or a completely new method.

    • February 17, 2020 at 10:40 pm #26096
      Chad Butler
      Keymaster

      Anything that is included in the deprecated file will still work – although you should be cautious about using it because it will eventually be removed. Usually, the inline docs for the deprecated function will indicate which function you should use instead of the deprecated version. In this case, it’s wpmem_email_to_user().

      I updated the script to note this. I also removed the “include” which is no longer necessary and removed unnecessary constants.

      https://rocketgeek.com/tips-and-tricks/change-the-wordpress-new-user-registration-email-to-use-the-wp-members-email/

      Just the code:
      https://rocketgeek.com/code-snippets/change-the-wordpress-new-user-registration-email-to-use-the-wp-members-email/

      Hope that helps.

  • Author
    Posts
Viewing 10 reply threads
  • You must be logged in to reply to this topic.
Log In

Ready to get started?

Join Today!

© 2021 · butlerblog.com · RocketGeek is built using WordPress, WP-Members, and the Genesis Framework

  • butlerblog.com
  • WP-Members Support Subscription
  • Terms of Service
  • Refund Policy