You'll actually need to edit two files:
1. /includes/modules/mytemplate/create_account.php. Here's a code fragment that starts at line 415 in v1.5.1:
You'll change this to:Code:// send additional emails if (SEND_EXTRA_CREATE_ACCOUNT_EMAILS_TO_STATUS == '1' and SEND_EXTRA_CREATE_ACCOUNT_EMAILS_TO !='') { if ($_SESSION['customer_id']) { $account_query = "select customers_firstname, customers_lastname, customers_email_address, customers_telephone, customers_fax from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$_SESSION['customer_id'] . "'"; $account = $db->Execute($account_query); } $extra_info=email_collect_extra_info($name,$email_address, $account->fields['customers_firstname'] . ' ' . $account->fields['customers_lastname'], $account->fields['customers_email_address'], $account->fields['customers_telephone'], $account->fields['customers_fax']); $html_msg['EXTRA_INFO'] = $extra_info['HTML']; if (trim(SEND_EXTRA_CREATE_ACCOUNT_EMAILS_TO_SUBJECT) != 'n/a') zen_mail('', SEND_EXTRA_CREATE_ACCOUNT_EMAILS_TO, SEND_EXTRA_CREATE_ACCOUNT_EMAILS_TO_SUBJECT . ' ' . EMAIL_SUBJECT, $email_text . $extra_info['TEXT'], STORE_NAME, EMAIL_FROM, $html_msg, 'welcome_extra'); } //endif send extra emails
2. /includes/functions/functions_email.php. Note that this is a core-file edit and the file will be changed again in v1.6.0! Make a backup copy (functions_email.php.v151) before you start! Change the function email_collect_extra_info to include the company input:Code:// send additional emails if (SEND_EXTRA_CREATE_ACCOUNT_EMAILS_TO_STATUS == '1' and SEND_EXTRA_CREATE_ACCOUNT_EMAILS_TO !='') { if ($_SESSION['customer_id']) { $account_query = "select customers_firstname, customers_lastname, customers_email_address, customers_telephone, customers_fax from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$_SESSION['customer_id'] . "'"; $account = $db->Execute($account_query); } $extra_info=email_collect_extra_info($name,$email_address, $account->fields['customers_firstname'] . ' ' . $account->fields['customers_lastname'], $account->fields['customers_email_address'], $account->fields['customers_telephone'], $account->fields['customers_fax'], $company); $html_msg['EXTRA_INFO'] = $extra_info['HTML']; if (trim(SEND_EXTRA_CREATE_ACCOUNT_EMAILS_TO_SUBJECT) != 'n/a') zen_mail('', SEND_EXTRA_CREATE_ACCOUNT_EMAILS_TO, SEND_EXTRA_CREATE_ACCOUNT_EMAILS_TO_SUBJECT . ' ' . EMAIL_SUBJECT, $email_text . $extra_info['TEXT'], STORE_NAME, EMAIL_FROM, $html_msg, 'welcome_extra'); } //endif send extra emails
Code:function email_collect_extra_info($from, $email_from, $login, $login_email, $login_phone='', $login_fax='', $company='') { // get host_address from either session or one time for both email types to save server load if (!$_SESSION['customers_host_address']) { if (SESSION_IP_TO_HOST_ADDRESS == 'true') { $email_host_address = @gethostbyaddr($_SERVER['REMOTE_ADDR']); } else { $email_host_address = OFFICE_IP_TO_HOST_ADDRESS; } } else { $email_host_address = $_SESSION['customers_host_address']; } // generate footer details for "also-send-to" emails $extra_info=array(); $extra_info['TEXT'] = OFFICE_USE . "\t" . "\n" . OFFICE_FROM . "\t" . $from . "\n" . OFFICE_EMAIL. "\t" . $email_from . "\n" . (trim($login) !='' ? OFFICE_LOGIN_NAME . "\t" . $login . "\n" : '') . (trim($login_email) !='' ? OFFICE_LOGIN_EMAIL . "\t" . $login_email . "\n" : '') . ($login_phone !='' ? OFFICE_LOGIN_PHONE . "\t" . $login_phone . "\n" : '') . ($login_fax !='' ? OFFICE_LOGIN_FAX . "\t" . $login_fax . "\n" : '') . ($company != '' ? 'Company Name:' . "\t" . $company . "\n": '') . OFFICE_IP_ADDRESS . "\t" . $_SESSION['customers_ip_address'] . ' - ' . $_SERVER['REMOTE_ADDR'] . "\n" . OFFICE_HOST_ADDRESS . "\t" . $email_host_address . "\n" . OFFICE_DATE_TIME . "\t" . date("D M j Y G:i:s T") . "\n\n"; $extra_info['HTML'] = '<table class="extra-info">' . '<tr><td class="extra-info-bold" colspan="2">' . OFFICE_USE . '</td></tr>' . '<tr><td class="extra-info-bold">' . OFFICE_FROM . '</td><td>' . $from . '</td></tr>' . '<tr><td class="extra-info-bold">' . OFFICE_EMAIL. '</td><td>' . $email_from . '</td></tr>' . ($login !='' ? '<tr><td class="extra-info-bold">' . OFFICE_LOGIN_NAME . '</td><td>' . $login . '</td></tr>' : '') . ($login_email !='' ? '<tr><td class="extra-info-bold">' . OFFICE_LOGIN_EMAIL . '</td><td>' . $login_email . '</td></tr>' : '') . ($login_phone !='' ? '<tr><td class="extra-info-bold">' . OFFICE_LOGIN_PHONE . '</td><td>' . $login_phone . '</td></tr>' : '') . ($login_fax !='' ? '<tr><td class="extra-info-bold">' . OFFICE_LOGIN_FAX . '</td><td>' . $login_fax . '</td></tr>' : '') . ($company != '' ? '<tr><td class="extra-info-bold">' . 'Company Name:' . '</td><td>' . $company . '</td></tr>' : '') . '<tr><td class="extra-info-bold">' . OFFICE_IP_ADDRESS . '</td><td>' . $_SESSION['customers_ip_address'] . ' - ' . $_SERVER['REMOTE_ADDR'] . '</td></tr>' . '<tr><td class="extra-info-bold">' . OFFICE_HOST_ADDRESS . '</td><td>' . $email_host_address . '</td></tr>' . '<tr><td class="extra-info-bold">' . OFFICE_DATE_TIME . '</td><td>' . date('D M j Y G:i:s T') . '</td></tr>' . '</table>'; return $extra_info; }


Reply With Quote
