Skip to:
Content
Pages
Categories
Search
Top
Bottom

How update default emal preference code ?


  • website001
    Participant

    @website001

    Hello friends

    Got this code from buddydev website

    for theme functions php

    works, but newer versions of buddypress have
    5 group options. This code covers 4.

    ——————————————————————————————————
    add_action( ‘bp_core_activated_user’,

    ‘bpdev_set_email_notifications_preference’);

    function bpdev_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 );
    }

    //that’s it. have fun!

    }

    ———————————————————————————————————

    This is the option it doesn’t cover—–

    #5
    “Your request to join a group has been approved or denied”

    Can anyone update this ? That would be awsome.

    Thanks alot

    buddypress 2.8.2
    WordPress 4.7.5

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

  • toibox
    Participant

    @toibox

    @website001

    Did you ever manage to figure this out? I’ve looked through both the WP and BP Codices and I had no luck in tracking down the documentation for the bpdev_set_email_notifications_preference function. I reached out to another person on a different thread who seemed to have some insight into this matter. I’ll let you know if, when and what I hear back. I’m interested in figuring this out b/c as of the time of this posting there are two additional group options that I need to default to “off.” If you’ve figured out how to handle your #5 option, I would greatly appreciate you sharing your findings with me.

    Thank you.

    Sincerely,
    Robert


    AWOL
    Participant

    @awol

    I know this is an old thread but I was searching for the same thing, and after encountering this thread I discovered a little free plugin on Github – https://github.com/hwdsbcommons/bp-no-email-notifications – which I have just installed and appears to be working with no issues.Hope it helps someone else and thank you to hwdsbcommons for creating the plugin.


    Xem Truyện
    Participant

    @xemtruyen

    Did you ever manage to figure this out? I’ve looked through both the WP and BP Codices and I had no luck in tracking down the documentation for the bpdev_set_email_notifications_preference function. I reached out to another person on a different thread who seemed to have some insight into this matter. I’ll let you know if, when and what I hear back. I’m interested in figuring this out b/c as of the time of this posting there are two additional group options that I need to default to “off.” If you’ve figured out how to handle your #5 option, I would greatly appreciate you sharing your findings with me.

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