• Resolved 63N

    (@63n)


    Firstly, great plugin!

    Although, I assumed that any user with the ‘Administrator’ role would receive email notifications for new registration requests, but it seems only the ‘Super Admin’ gets the notifications? (Or maybe it’s only the email set in Settings>General?)

    In the Changelog under 1.5.3 it says:

    add filter for adding more email addresses to get notifications

    Could you give an example of how to use this filter to add more email address for notifications?
    I have a child theme set up with a custom functions.php file to put the code in, I just need to know what to write!

    Also, is it possible to only send notifications to those addresses and stop sending them to the default email address, because I set a site up for a client and I don’t want to keep getting notification emails from their site.

    Thanks in advance!

    https://www.ads-software.com/plugins/new-user-approve/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter 63N

    (@63n)

    I don’t know php, but after looking at other posts, your files on gist and searching through the source code for a filter I put this together:

    // send new registration notifications to additional email addresses
    function additional_registration_notifications( $to ) {
    	$to = 'CUSTOM EMAIL ADDRESSES';
    	return $to;
    }
    // add new email address to the notification list
    add_filter( 'new_user_approve_email_admins', 'additional_registration_notifications' );

    But I get an error when I use this?

    EDIT: the error after the registration form is submitted – Warning: array_unique() [function.array-unique]: The argument should be an array in…

    I had the same problem. You were close, I had our web consultant look at it and found the following code to work. You will need to put this in the functions.php file.

    // send new registration notifications to additional email addresses
    function additional_registration_notifications( $to ) {
       $to = array('email-1', 'email-2', 'email-3',...);
       return $to;
    }
    add_filter( 'new_user_approve_email_admins', 'additional_registration_notifications' );

    Hope this helps.

    Thread Starter 63N

    (@63n)

    Awesome, that seems to be working perfectly, and it overrides the default.

    Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Add more email adresses to get notifications, remove default address’ is closed to new replies.