############################################### 
##   Hack Title:   Email address on welcome, and activation emails.
##   Hack Version:   1.0.0
##   Author:      Antony Bailey 
##   Description:   Adds the users email for the account to the email. 
##   Compatibility:   2.0.4 
## 
##   Installation Level: Easy
##   Installation Time: 5 minutes 
##   Files To Edit: 4 
##      usercp_register.php 
##      user_welcome.tpl
##	user_welcome_inactive.tpl
##	admin_activate.tpl
## 
## 
##   History: 
##      1.0.0:    Initial Release.
## 
##   Author Notes: 
##      Odd, request.
## 
##   Support:      http://www.phpbbhacks.com/forums 
##   Copyright:      2003 Email address on welcome, and activation emails. 1.0.0 - Antony Bailey
## 
############################################### 
##   You downloaded this hack from phpBBHacks.com, the #1 source for phpBB related downloads. 
##   Please visit http://www.phpbbhacks.com/forums for support. 
############################################### 
## 
############################################### 
##   This hack is released under the GPL License. 
##   This hack can be freely used, but not distributed, without permission. 
##   Intellectual Property is retained by the hack author(s) listed above. 
############################################### 

# 
#-----[ OPEN ]------------------------------------------ 
#
includes/usercp_register.php

# 
#-----[ FIND ]------------------------------------------ 
# 
				//
				// The users account has been deactivated, send them an email with a new activation key
				//
				include($phpbb_root_path . 'includes/emailer.'.$phpEx);
				$emailer = new emailer($board_config['smtp_delivery']);

				$email_headers = "From: " . $board_config['board_email'] . "\nReturn-Path: " . $board_config['board_email'] . "\n";

				$emailer->use_template('user_activate', stripslashes($user_lang));
				$emailer->email_address($email);
				$emailer->set_subject($lang['Reactivate']);
				$emailer->extra_headers($email_headers);

				$emailer->assign_vars(array(
					'SITENAME' => $board_config['sitename'],
# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 
					'EMAIL_ADDRESS' => $email,
# 
#-----[ FIND ]------------------------------------------ 
# 
			if ( $coppa )
			{
				$message = $lang['COPPA'];
				$email_template = 'coppa_welcome_inactive';
			}
			else if ( $board_config['require_activation'] == USER_ACTIVATION_SELF )
			{
				$message = $lang['Account_inactive'];
				$email_template = 'user_welcome_inactive';
			}
			else if ( $board_config['require_activation'] == USER_ACTIVATION_ADMIN )
			{
				$message = $lang['Account_inactive_admin'];
				$email_template = 'admin_welcome_inactive';
			}
			else
			{
				$message = $lang['Account_added'];
				$email_template = 'user_welcome';
			}

			include($phpbb_root_path . 'includes/emailer.'.$phpEx);
			$emailer = new emailer($board_config['smtp_delivery']);

			$email_headers = "From: " . $board_config['board_email'] . "\nReturn-Path: " . $board_config['board_email'] . "\n";

			$emailer->use_template($email_template, stripslashes($user_lang));
			$emailer->email_address($email);
			$emailer->set_subject(sprintf($lang['Welcome_subject'], $board_config['sitename']));
			$emailer->extra_headers($email_headers);

			if( $coppa )
			{
				$emailer->assign_vars(array(
					'SITENAME' => $board_config['sitename'],
					'WELCOME_MSG' => sprintf($lang['Welcome_subject'], $board_config['sitename']),
					'USERNAME' => $username,
					'PASSWORD' => $password_confirm,
					'EMAIL_SIG' => str_replace('<br />', "\n", "-- \n" . $board_config['board_email_sig']),
# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 
					'EMAIL_ADDRESS' => $email,
# 
#-----[ FIND ]------------------------------------------ 
# 
			if ( $board_config['require_activation'] == USER_ACTIVATION_ADMIN )
			{
				//$emailer->use_template("admin_activate", stripslashes($user_lang));
				$emailer->use_template("admin_activate", $board_config['default_lang']);
				$emailer->email_address($board_config['board_email']);
				$emailer->set_subject($lang['New_account_subject']);
				$emailer->extra_headers($email_headers);

				$emailer->assign_vars(array(
					'USERNAME' => $username,
# 
#-----[ AFTER, ADD ]------------------------------------------ 
#
					'EMAIL_ADDRESS' => $email,
# 
#-----[ OPEN ]------------------------------------------ 
#
language/language_english/email/user_welcome.tpl
# 
#-----[ FIND ]------------------------------------------ 
# 

{EMAIL_SIG}

# 
#-----[ BEFORE, ADD ]------------------------------------------ 
# 
This account is registered to the email address: {EMAIL_ADDRESS}
# 
#-----[ OPEN ]------------------------------------------ 
#
language/language_english/email/user_welcome_inactive.tpl
# 
#-----[ FIND ]------------------------------------------ 
# 

{EMAIL_SIG}

# 
#-----[ BEFORE, ADD ]------------------------------------------ 
# 
This account is registered to the email address: {EMAIL_ADDRESS}
# 
#-----[ OPEN ]------------------------------------------ 
#
language/language_english/email/admin_activate.tpl

# 
#-----[ FIND ]------------------------------------------ 
# 

{EMAIL_SIG}
# 
#-----[ BEFORE, ADD ]------------------------------------------ 
# 
This account is registered to the email address: {EMAIL_ADDRESS}
# 
#-----[ SAVE & CLOSE ALL FILES ]------------------------------------------ 
# 
# End