Skip to:
Content
Pages
Categories
Search
Top
Bottom

Disable All Notifications

  • Okay I apologize to bring kind of an old subject back up, but when looking online I never really got a definite answer I really understood on how to disable all e-mail notifications sent out by BuddyPress. I need to do this because my hosting will see too many mails sent out as “mass mail” and can suspend my account.

    So I found one topic that suggested looking at my BP Plug-in files for any that have the words “notifications” in them. Here is a part of one file I found, I was hoping if someone hear could tell me if this is the line of code I need to edit.

    The code was found in : buddypress/bp-messages/bp-messages-notifications.php

    ` foreach( $recipients as $recipient ) {
    if ( $sender_id == $recipient->user_id || ‘no’ == bp_get_user_meta( $recipient->user_id, ‘notification_messages_new_message’, true ) )
    continue;`
    This is what caught my eye mainly…
    `( $sender_id == $recipient->user_id || ‘no’ == bp_get_user_meta( $recipient->user_id, ‘notification_messages_new_message’, true ) )`

    Where it says “true” would changing that to false or no set them up by default to receive not email notifications? Or is this for the in-site notifications?

Viewing 1 replies (of 1 total)
  • Okay I found a way around this. I used the code supplied via one post, the one that said you should place the code in the functions.php file of your theme which would make all new registered users notifications setting turned off. Only problem was then… when I cut the ability for users to updated there profile setting it also allowed them to change the notification settings. Which would allow users to turn them back on.

    So I headed to the BuddyPress plugin files and started searching. Looking for files with the names “Settings” in them I opened them all up and started searching for anything mentioning “Notifications” settings. Here are the two pieces of code that I found in the files and removed them. Went to my test user account, then to settings, and the ability to update/change my “Notifications” settings from their could no longer be seen. Worked… so here are the 2 pieces of code to look for an remove.

    First:
    `// Add Notifications nav item
    $sub_nav[] = array(
    ‘name’ => __( ‘Notifications’, ‘buddypress’ ),
    ‘slug’ => ‘notifications’,
    ‘parent_url’ => $settings_link,
    ‘parent_slug’ => $this->slug,
    ‘screen_function’ => ‘bp_core_screen_notification_settings’,
    ‘position’ => 20,
    ‘user_has_access’ => bp_core_can_edit_settings()
    );`

    Second:
    `/** Notifications *************************************************************/

    function bp_core_screen_notification_settings() {
    global $bp;

    if ( bp_action_variables() ) {
    bp_do_404();
    return;
    }

    if ( isset( $_POST ) ) {
    check_admin_referer(‘bp_settings_notifications’);

    if ( isset( $_POST ) ) {
    foreach ( (array)$_POST as $key => $value ) {
    if ( $meta_key = bp_get_user_meta_key( $key ) )
    bp_update_user_meta( (int)$bp->displayed_user->id, $meta_key, $value );
    }
    }

    bp_core_add_message( __( ‘Changes saved.’, ‘buddypress’ ), ‘success’ );

    do_action( ‘bp_core_notification_settings_after_save’ );
    }

    bp_core_load_template( apply_filters( ‘bp_core_screen_notification_settings’, ‘members/single/settings/notifications’ ) );
    }`

Viewing 1 replies (of 1 total)
  • The topic ‘Disable All Notifications’ is closed to new replies.
Skip to toolbar