buddypress 為用户啓用默認電子郵件通知的設置,方便接收相關信息。

正在查看 2 個帖子:1-2 (共 2 個帖子)
  • 作者
    帖子
  • 詩語
    管理員
    • 文章數量: 5,930
    @feibisi
    樓主
    0

    buddypress 默認也是需要用户勾選電子郵件通知後才會發送郵件,如果要調整成默認就發送的可以在子主題 functions.php 中嘗試以下代碼:

    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 );
        }
    
    }
    詩語
    管理員
    • 文章數量: 5,930
    @feibisi
    樓主
    0

    還有個插件也能實現相同功能,這個需要自己下載,插件作者提供有舊版本的免費下載應該都是可以用的。

    BuddyPress Default Email Notification Settings Control

    下載方式直接點 download 按鈕

正在查看 2 個帖子:1-2 (共 2 個帖子)
  • 哎呀,回覆話題必需登錄。

話題信息

  • 當前位於:BuddyPress
  • 1 條回覆
  • 1 個參與人
  • 最後回覆:<a href="https://bbs.weixiaoduo.com/users/feibisi/" title=" 查看詩語的個人資料" class="bbp-author-link"><span class="bbp-author-name"> 詩語</span></a>
  • 上次活動:<a href="https://bbs.weixiaoduo.com/topic/28886/#post-28888" title=" 回覆至:buddypress 為用户啓用默認電子郵件通知的設置,方便接收相關信息。">6 年、 5 月前</a>