Skip to:
Content
Pages
Categories
Search
Top
Bottom

Do notices send emails to users? Where to configure?


  • jgasba
    Participant

    @jgasba

    The Codex mentions here that there is a page in Settings > Email but I don’t see it.

    So I have 2 questions : by default, does sending a notice as an admin to all users triggers a mail to be sent?

    And if so where do I configure/disable it? With 40000 users I’d like to be able to notify users but not send a load of email spam.

Viewing 1 replies (of 1 total)

  • jgasba
    Participant

    @jgasba

    For the posterity: the Codex was not very clear for newer user: the Settings > Email mentionned is in the public user profile settings, and only available if you have the “Notifications” component enabled.

    It does not allow to define the default values for the users settings. Each user can customize their own themselves.

    If I’m not mistaken to customize the “default” you can use this code:

    
    add_action( 'bp_core_activated_user', 'wps_set_email_notifications_preference');
      
    function wps_set_email_notifications_preference( $user_id ) {
     
        $settings = array(
            'notification_activity_new_mention'         => 'yes',
            'notification_activity_new_reply'           => 'yes',
            'notification_friends_friendship_accepted'  => 'yes',
            'notification_friends_friendship_request'   => 'yes',
            'notification_groups_admin_promotion'       => 'yes',
            'notification_groups_group_updated'         => 'yes',
            'notification_groups_invite'                => 'yes',
            'notification_groups_membership_request'    => 'yes',
            'notification_messages_new_message'         => 'yes',
        );
      
        foreach( $settings as $setting => $preference ) {
            bp_update_user_meta( $user_id,  $setting, $preference );
        }
    }
    
Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.
Skip to toolbar