• Resolved Nik

    (@nikbond)


    Many thanks for a really useful plug-in and following the suggestions in this thread (https://www.ads-software.com/support/topic/2-member-typed-different-registration-permission/), I’ve managed to set things up so that members with a member type of “visitor” no longer require moderating however… admin is still receiving an email telling them that they do.

    I thought I’d try and edit includes/core.php to check for bp_registration_get_moderation_status( $user ) or even bp_get_member_type ($user) prior to sending the email but for some reason $user doesn’t seem to be behaving as I would expect and therefore the logic is failing.

    If you have any suggestions as to how to prevent emails (to admin and/or the user) being sent out based on a specific member type (or moderation status), I’d be very grateful.

    With many thanks in advance.

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

    (@tw2113)

    The BenchPresser

    For the pending user who’s signing up, you can use this:

    remove_action( ‘bp_core_activated_user’, ‘bp_registration_options_notify_pending_user’, 10, 3 );

    Regarding admin emails, we simply don’t have any way set up to not send those at the moment.

    To help remind myself later: https://github.com/WebDevStudios/BuddyPress-Registration-Options/issues/176

    Thread Starter Nik

    (@nikbond)

    Many thanks for getting back to me Michael.

    I did wonder if one of the ways of handling this or at least getting around it, would be to create a new email shortcode/token depending on whether a user needed moderating or not eg. along with [username] and [user-email], there could be a [moderation_required] token which might at least allow a slightly more meaningful email to be sent to admin.

    Either way, if there isn’t currently a filter for the admin emails, it looks as if for now I’m going to have to edit your code somehow whether to edit the message or prevent it getting sent out altogether so if you have any suggestions on that, it would be very much appreciated but I’ll also look out for any updates from you in due course.

    Michael Beckwith

    (@tw2113)

    The BenchPresser

    I was very likely going to add a WP filter that defaults to false along some lines of “prevent email notification”. Where I check if it’s been set to true, return early.

    Pseudocode:

    if ( apply_filters( 'prevent_email_notification', false ) ) {
    	return;
    }
    

    That return statement example would only be reached if someone filtered that and returned true. Beyond that, no details officially ironed out.

    Thread Starter Nik

    (@nikbond)

    Many thanks Michael. I’ll have a bit more of a play myself when I have time and if I come up with any ideas I’ll let you know. In the meantime, will also look out for any updates…

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Suppress emails’ is closed to new replies.