Skip to:
Content
Pages
Categories
Search
Top
Bottom

Email notification default settings


  • Demiano
    Participant

    @demiano

    Hi,
    Email notification settings are set to YES for all kinds of incidents by default.

    How can I set them to NO by default, so people can actually opt to receive emails as they prefer?
    This would be an important feature and is even more important now that GDPR is araound the corner.

    I have seen a thread about it that is 3 years old and has no workable solution.
    Please help.

    Thanks,
    Demian

Viewing 4 replies - 1 through 4 (of 4 total)

  • Varun Dubey
    Participant

    @vapvarun

    @demiano You can try following codes inside your child theme functions.php or use code snippet plugin

    
    add_action( 'bp_core_activated_user', 'wb_set_email_notifications_preference');
     
    function wp_set_email_notifications_preference( $user_id ) {
     
        //I am putting all the notifications to no by default
        //you can set the value to 'yes' if you want that notification to be enabled.
        $settings_keys = array(
            'notification_activity_new_mention'         => 'no',
            'notification_activity_new_reply'           => 'no',
            'notification_friends_friendship_request'   => 'no',
            'notification_friends_friendship_accepted'  => 'no',
            'notification_groups_invite'                => 'no',
            'notification_groups_group_updated'         => 'no',
            'notification_groups_admin_promotion'       => 'no',
            'notification_groups_membership_request'    => 'no',
            'notification_messages_new_message'         => 'no',
        );
     
        foreach( $settings_keys as $setting => $preference ) {
     
            bp_update_user_meta( $user_id,  $setting, $preference );
        }
    
    }
    

    Demiano
    Participant

    @demiano

    Thanks Vapvarun, for your answer and the code.

    Unfortunately the default settings for my test user stay the same. I have no idea why.

    This issue is actually very important. The Privacy and data security regulations of the GDBR coming on 25th include strict regulations about people giving specifc consent to the emails they receive. Many people will be very sensitive about this.

    I hope there is a solution.

    Thanks,
    Demian


    Varun Dubey
    Participant

    @vapvarun


    Demiano
    Participant

    @demiano

    This worked. Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.
Skip to toolbar