Group Mods

  • Profile picture of @mercime
  • Profile picture of r-a-y
  • Profile picture of Hugo

Disabling certain email notifications by default for new members (8 posts)

Started 2 years, 3 months ago by: jimmiejo

  • Profile picture of jimmiejo jimmiejo said 2 years, 3 months ago:

    If I’m not mistaken, all of the email notifications for members are enabled (set to Yes) by default in the notifications settings. Is there any way to customize these settings through a function to disable a few of them for all future members that register?

    I personally prefer the on-site notifications for everything but private messages, and think members of the communities I’m developing would as well.

    Thanks.

  • Profile picture of vonWolfehaus vonWolfehaus said 1 year, 3 months ago:

    I totally agree with this. I couldn’t find the place where to reset default notification settings, so I’m bumping this in the hopes that someone would know this.

  • Profile picture of SteveGron SteveGron said 1 year, 3 months ago:

    I believe the settings are in the my account settings under notifications

  • Profile picture of Gayatriom Gayatriom said 1 year, 2 months ago:

    Yes.
    but how can we set them for ALL new members?

  • Profile picture of rmazereeuw rmazereeuw said 1 year, 2 months ago:

    I’d love this as well. Just a way to make them all off by default for all users, and let them choose to turn them on if they want.

  • Profile picture of juss juss said 1 year, 1 month ago:

    bump!

  • Profile picture of Boone Gorges Boone Gorges said 1 year, 1 month ago:

    The best way to do this, at the moment, is to hook a function to one of the signup functions (perhaps the do_action hook ‘bp_core_activated_user’, found in bp-core/bp-core-signup.php), and to save a set of default settings when a user registers.

  • Profile picture of fancyfiber fancyfiber said 6 months, 2 weeks ago:

    First thanks to Boone Gorges for the direction on how to get started with this. And for those looking for a complete answer. Add this code (or similar) to your Theme functions.php file (my apologies if there is a better way to paste code…first time posting here):

    function set_default_notifications($user_id, $key, $user) {
    $valueyes = ‘yes’;
    $valueno = ‘no’;

    $new_messages = bp_get_user_meta_key(‘notification_messages_new_message’ );
    bp_update_user_meta( $user_id, $new_messages, $valueyes );

    $new_notices = bp_get_user_meta_key(‘notification_messages_new_notice’ );
    bp_update_user_meta( $user_id, $new_notices, $valueno );

    $group_invite = bp_get_user_meta_key(‘notification_groups_invite’ );
    bp_update_user_meta( $user_id, $group_invite, $valueyes );

    $group_update = bp_get_user_meta_key(‘notification_groups_group_updated’ );
    bp_update_user_meta( $user_id, $group_update, $valueno );

    $group_promo = bp_get_user_meta_key(‘notification_groups_admin_promotion’ );
    bp_update_user_meta( $user_id, $group_promo, $valueyes );

    $group_request = bp_get_user_meta_key(‘notification_groups_membership_request’ );
    bp_update_user_meta( $user_id, $group_request, $valueyes );

    $mention = bp_get_user_meta_key(‘notification_activity_new_mention’ );
    bp_update_user_meta( $user_id, $mention, $valueyes );

    $reply = bp_get_user_meta_key(‘notification_activity_new_reply’ );
    bp_update_user_meta( $user_id, $reply, $valueyes );

    $send_requests = bp_get_user_meta_key(‘notification_friends_friendship_request’ );
    bp_update_user_meta( $user_id, $send_requests, $valueyes );

    $accept_requests = bp_get_user_meta_key(‘notification_friends_friendship_accepted’ );
    bp_update_user_meta( $user_id, $accept_requests, $valueno );
    do_action( ‘bp_core_notification_settings_after_save’ );

    }
    add_action(‘bp_core_activated_user’, ‘set_default_notifications’, 10, 3);