• Resolved terry789

    (@terry789)


    How can I have the New member request email sent to the Administrator and a self-created role in plugin User Role Editor?

    For example role with the name “User1”

    Thanks

Viewing 15 replies - 1 through 15 (of 22 total)
  • Michael Beckwith

    (@tw2113)

    The BenchPresser

    Just to make sure I’m interpreting this correct, you want to expand who receives the notification to be going to both the site admin, and then whoever may also have this custom role that you’re going to set up?

    Thread Starter terry789

    (@terry789)

    @michael

    Yes, you understood that correctly.

    Custom role is “User1” (for example)

    Michael Beckwith

    (@tw2113)

    The BenchPresser

    Borrowing from myself 3 days ago…

    function terry_bpro_single_admin_notice( $current_admins ) {
    	$custom_admins = get_users( 'role=ENTER_ROLE_HERE' );
    
    	foreach( $custom_admins as $custom_admin ) {
    		// append new WP_Users into our passed in array
    		$current_admins[] = $custom_admin;
    	}
    
    	return $current_admins;
    }
    add_filter( 'bprwg_bp_notification_users', 'terry_bpro_single_admin_notice' );
    

    This code should handle. The $current_admins will be an array of WP_User objects who have the “administrator” role, and we push the WP_User objects from your custom role into the array, and pass it back.

    Give it a try, make sure to fill in the final result for the role you’re going to make.

    Thread Starter terry789

    (@terry789)

    pasted your complete piece at the bottom of my functions.php, after last line see:

    }
    
    add_filter( 'rtmedia_no_media_found_message_filter', 'custom_no_media_found_message_function' ,10, 1 );

    Then get critical error as a notification… ???

    Thread Starter terry789

    (@terry789)

    Received an email from the site about this error (names changed of course)

    First visit your site and see if there are any visible problems.
    Then visit the page where the error was found (https://xxxxx.nl/xxxxxxxx/xxxxxx/wp-admin/users.php?role=user1) and see if there are any visible problems.

    I hope this helps

    Michael Beckwith

    (@tw2113)

    The BenchPresser

    What’s the actual error message you’re seeing?

    Thread Starter terry789

    (@terry789)

    Only a small window with:
    A critical error has occurred on your site.

    Thread Starter terry789

    (@terry789)

    I also use the plugin:
    Multiple Admin Email Addresses
    These are separated by a comma (2 addresses)

    If you can manage to send the “New member request” email to these two addresses, that’s fine too

    Michael Beckwith

    (@tw2113)

    The BenchPresser

    Typically, at least from what I’ve seen, the email notifications for the site experienced an issue stuff, will provide at least some of the actual error.

    Thread Starter terry789

    (@terry789)

    I remember another conflict with the two addresses in the administrator settings.

    see here

    Maybe that has to do with this too?

    Michael Beckwith

    (@tw2113)

    The BenchPresser

    Potentially, but hard to say for certain. I am guessing they’re probably filtering the arguments passed to wp_mail()

    Thread Starter terry789

    (@terry789)

    I have disabled / removed the duplicate email function but this has no effect. I am still getting the critical error.

    Any more ideas?

    Michael Beckwith

    (@tw2113)

    The BenchPresser

    Not without actually seeing the error in question. Your hosting provider will probably have a spot to review error logs.

    Thread Starter terry789

    (@terry789)

    I have a test site. Is access useful to you?

    Michael Beckwith

    (@tw2113)

    The BenchPresser

    Not too much unless it shows errors better. If you’re able to access it still, the contents of your functions.php would actually be better from my end, because I could at least check for possible php errors or try the file on a local install.

Viewing 15 replies - 1 through 15 (of 22 total)
  • The topic ‘New member request email’ is closed to new replies.