I have my board setup such that I have to activate new users.
I have few options for activating users.
The first is to click on the link in the email I get which launches the /includes/ucp/ucp_activate.php file and then sends out the email to the user (to let them know the account has been activated).
- Code: Select all
if ($config['require_activation'] == USER_ACTIVATION_ADMIN && !$update_password)
{
include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
$messenger = new messenger(false);
$messenger->template('admin_welcome_activated', $user_row['user_lang']);
$messenger->to($user_row['user_email'], $user_row['username']);
$messenger->headers('X-AntiAbuse: Board servername - ' . $config['server_name']);
$messenger->headers('X-AntiAbuse: User_id - ' . $user->data['user_id']);
$messenger->headers('X-AntiAbuse: Username - ' . $user->data['username']);
$messenger->headers('X-AntiAbuse: User IP - ' . $user->ip);
$messenger->assign_vars(array(
'USERNAME' => htmlspecialchars_decode($user_row['username']))
);
$messenger->send($user_row['user_notify_type']);
$message = 'ACCOUNT_ACTIVE_ADMIN';
}
The second is to go into the ACP and I can view Inactive Users and then mark them and then select activate and submit. This method (as far as I can tell) calls the includes/acp/acp_inactive.php file.
- Code: Select all
if ($config['require_activation'] == USER_ACTIVATION_ADMIN && !empty($inactive_users))
{
include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
$messenger = new messenger();
foreach ($inactive_users as $row)
{
$messenger->template('admin_welcome_activated', $row['user_lang']);
$messenger->to($row['user_email'], $row['username']);
$messenger->headers('X-AntiAbuse: Board servername - ' . $config['server_name']);
$messenger->headers('X-AntiAbuse: User_id - ' . $user->data['user_id']);
$messenger->headers('X-AntiAbuse: Username - ' . $user->data['username']);
$messenger->assign_vars(array(
'USERNAME' => htmlspecialchars_decode($row['username']))
);
$messenger->send(NOTIFY_EMAIL);
}
$messenger->save_queue();
}
In looking at the code for each it appears the only material difference is that the ACP uses the "queue" approach to sending mail and the UCP approach sends the email right then and there. Both use the messenger to send the email and both seem to setup the messenger object exactly the same.
When I use the UCP approach it works just fine and my test user gets the email just fine.
When I use the ACP approach I never get the email.
I just setup this board and its just me and my test user accounts. I have test accounts that I setup then activate, etc.
Thanks!!
-Rob


