Gautam that is the source.i adopted it from Thomas Klaiber post notification plugin.Klaiber plugin sends one email notification on topics in their favourites only without the contents.so i need to figure out how to reply to a post through email.
<?php
function notification_new_post()
{
global $bbdb, $bb_table_prefix, $topic_id,$bb_current_user,$post_id;
$all_users = notification_select_all_users();
foreach ($all_users as $userdata) :
$topic = get_topic($topic_id);
$posts = get_thread($topic_id, 1, 1);
$posts = array_reverse($posts);
$last = array_pop($posts);
$last_text = strip_tags($last->post_text);
$message = __("There is a new post on the forum\n\nTopic title: %1\$s \nPosted by: %2\$s\n\n Url:%3\$s \n\n Contents \n\n %4\$s");
mail( $userdata->user_email, bb_get_option('name') . ':' . __('Notification'),
sprintf( $message, $topic->topic_title,get_user_name($bb_current_user->ID),get_topic_link($topic_id),$last_text),
'From: ' . bb_get_option('admin_email') );
endforeach;
}
add_action('bb_new_post', 'notification_new_post');
function notification_select_all_users()
{
global $bbdb;
$all_users = $bbdb->get_results("SELECT ID, user_email FROM $bbdb->users WHERE user_status=0");
return $all_users;
}a
?>