In /catalog/tell_a_friend.php (around line 139) where the tep_mail() function is called you add the following AFTER the tep_mail() line:
// Mail a (silent) report to the web owner:
if (CONFIG_SEND_TO_A_FRIEND == 'true') {
// get ip
if (getenv('HTTP_X_FORWARDED_FOR')) {
$ip=getenv('HTTP_X_FORWARDED_FOR');
} else {
$ip=getenv('REMOTE_ADDR');
}
// build report
$report = 'Here are the details of the T.A.F. submission by ' . $from_name . ' on ' . date("D M j G:i:s Y") . ':';
$report .= "nn" . 'Recipient details: ' . $HTTP_POST_VARS['friendname'] . ' - ' . $HTTP_POST_VARS['friendemail'];
$report .= "n" . 'Sender details: ' . $from_name . ' - ' . $from_email_address;
$report .= "n" . 'Sender ip address: ' . $ip;
$report .= "n" . 'Personal message: ' . "nn" . $HTTP_POST_VARS['yourmessage'];
$report .= "nn" . 'Product link: ' . HTTP_SERVER . DIR_WS_CATALOG . FILENAME_PRODUCT_INFO . '?products_id=' . $HTTP_GET_VARS['products_id'];
// mail report
tep_mail('Tell A Friend', EMAIL_SEND_TO_A_FRIEND, '[ REPORT ] Tell a Friend Usage', stripslashes($report), '', $from_email_address);
}
insert into your MySQL database:
INSERT INTO configuration (configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('', 'Send To A Friend - Control ON/OFF', 'CONFIG_SEND_TO_A_FRIEND', 'true', 'Would you like to get an email when a visitor uses Send To A Friend ?', 12, 800, '2003-03-14 12:20:07', '2003-03-14 12:20:07', NULL, 'tep_cfg_select_option(array('true', 'false'),');
INSERT INTO configuration (configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('', 'Send To A Friend - Email', 'EMAIL_SEND_TO_A_FRIEND', 'your email', 'Send an Email to this address when someone uses Send to a friend option', 12, 801, '2003-03-14 12:20:07', '2003-03-14 12:20:07', NULL, NULL);
In /catalog/tell_a_friend.php (around line 139) where the tep_mail() function is called you add the following AFTER the tep_mail() line:
// Mail a (silent) report to the web owner:
if (CONFIG_SEND_TO_A_FRIEND == 'true') {
// get ip
if (getenv('HTTP_X_FORWARDED_FOR')) {
$ip=getenv('HTTP_X_FORWARDED_FOR');
} else {
$ip=getenv('REMOTE_ADDR');
}
// build report
$report = 'Here are the details of the T.A.F. submission by ' . $from_name . ' on ' . date("D M j G:i:s Y") . ':';
$report .= "nn" . 'Recipient details: ' . $HTTP_POST_VARS['friendname'] . ' - ' . $HTTP_POST_VARS['friendemail'];
$report .= "n" . 'Sender details: ' . $from_name . ' - ' . $from_email_address;
$report .= "n" . 'Sender ip address: ' . $ip;
$report .= "n" . 'Personal message: ' . "nn" . $HTTP_POST_VARS['yourmessage'];
$report .= "nn" . 'Product link: ' . HTTP_SERVER . DIR_WS_CATALOG . FILENAME_PRODUCT_INFO . '?products_id=' . $HTTP_GET_VARS['products_id'];
// mail report
tep_mail('Tell A Friend', EMAIL_SEND_TO_A_FRIEND, '[ REPORT ] Tell a Friend Usage', stripslashes($report), '', $from_email_address);
}
insert into your MySQL database:
this will put the config options in Admin > Configuration > E-mail options
INSERT INTO configuration (configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('', 'Send To A Friend - Control ON/OFF', 'CONFIG_SEND_TO_A_FRIEND', 'true', 'Would you like to get an email when a visitor uses Send To A Friend ?', 12, 800, '2003-03-14 12:20:07', '2003-03-14 12:20:07', NULL, 'tep_cfg_select_option(array('true', 'false'),');
INSERT INTO configuration (configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('', 'Send To A Friend - Email', 'EMAIL_SEND_TO_A_FRIEND', 'your email', 'Send an Email to this address when someone uses Send to a friend option', 12, 801, '2003-03-14 12:20:07', '2003-03-14 12:20:07', NULL, NULL);
thanks Mattice