Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: No Admin notification of new user


_ck_
Participant

@_ck_

Wow I can’t believe bbPress doesn’t do that.

I’ve whipped up a function to do it, should be in the plugin browser soon or try this:

<?php
/*
Plugin Name: New User Notification Email
*/
add_action('bb_new_user', 'new_user_notification');

function new_user_notification($user_id=0) {
if (!$user_id) {$user_id=bb_get_current_user_info( 'id' );}
$user=bb_get_user($user_id);

$message = sprintf(__('New user registration on %s:'), bb_get_option('name')) . "rnrn";
$message .= sprintf(__('Username: %s'), stripslashes($user->user_login)) . "rnrn";
$message .= sprintf(__('E-mail: %s'), stripslashes($user->user_email)) . "rnrn";

$message .= sprintf(__('Agent: %s'), substr(stripslashes($_SERVER["HTTP_USER_AGENT"]),0,80)) . "rnrn";
$message .= sprintf(__('IP: %s'), $_SERVER['REMOTE_ADDR']) . "rnrn";

$message .= sprintf(__('Profile: %s'), get_user_profile_link($user_id)) . "rnrn";

@bb_mail(bb_get_option('admin_email') , sprintf(__('[%s] New User Registration'), bb_get_option('name')), $message, '' );
}
?>

Skip to toolbar