Skip to:

Notify all forum users of new topic

  • I am running a small forum for a small private team.

    As it is for a small team, posts are made infrequently.

    In order to let people know when there is a new topic raised I would like to email ALL the forum users a notification of the new topic.

    It should be noted that I am integrating bbPress with WordPress. Not all my WordPress user have access to my forum. The solution needs to ONLY notify those users who have bbPress member or higher access.

    Is there an existing solution for this, or could anyone advise me on how to create one?

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

  • kevinjohngallagher


    The 2 simple solutions would be for the BBpress members to have an RSS feed reader, or you could e-mail them.

    What you’re looking for is a plugin that emails every member of a BBpress forum every time a new topic is started. I doubt anyone’s build anything like that because it would just end up adding to spam (even if it wouldn’t in your particular case).

    Yes indeed, I would like it to email the members.

    I understand that this is only relevant to small teams, but applications like 37signals’s Basecamp support emailing on a new thread, and it massively improves team collaboration.



    Depending on how many members you are talking about, or how many time you expect a new post to be on the forum, i would definitely be sceptical of something like this. It’s a massive hark back to the old ways of doing things.

    So my suggestions:

    1) When you make a new post, physically email everyone.

    I’m not sure when e-mail became incredibly difficult to do manually.

    2) If you really want to write a plugin it should go something like:

    function notification_new_post($post_id=0) {
    global $bbdb, $bb_table_prefix, $topic_id, $bb_current_user;

    $all_users = $bbdb->get_results("SELECT ID, user_email FROM $bbdb->users WHERE user_status=0");
    foreach ($all_users as $userdata)
    $message = __("There is a new post on: %1$s nReply by: %2$s nText: %3$s nn%4$s ");
    mail( $userdata->user_email, bb_get_option('name') . ': ' . __('Notification'),
    sprintf( $message, get_topic_title($topic_id), get_user_name($bb_current_user->ID), strip_tags(get_post_text($post_id)), get_topic_link($topic_id) ),
    'From: '.bb_get_option('name').' <'.bb_get_option('from_email').'>'
    } //foreach
    add_action('bb_new_post', 'notification_new_post');

    You may need to edit some of that code, but found that by searing for email notification on this website (props to Thomas Klaiber who’s code i quickly edited). Amazing what searching first does :)

    Again Neotoxic, i strongly suggest against this unless you know for sure that everyone’s going to be ok with getting an email everytime. RSS readers on email clients, phones, browsers etc save so much hassle…

    Take Care

    kevinjohngallagher – Thank you very much for your help. I understand you caution completely, however given the nature of my community I am sure that this will be appreciated.

    Can you confirm that the following will only select users who are bbpress members and above, and not all users in my WordPress users table.

    $bbdb->users WHERE user_status=0"



    Hi Neotoxic,

    No i’m afraid you’ll have to figure out your own SQL script for the users. My code isn’t tested or anything, i’m afraid you’ll have to write teh custom code for your own specific solution yourself. the code i’ve posted above just does 95% of the work for you :)

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