countingsheep Posted August 12, 2006 Share Posted August 12, 2006 I have included the option to privately send an email to the site owner through tell a friend feature, but the recipient info is blank when she receives the email. What do I need to change to get that to work? This is the line that shows those results: $report .= "\n\n" . 'Recipient details: ' . $HTTP_POST_VARS['friendname'] . ' - ' . $HTTP_POST_VARS['friendemail']; snippet of code that performs the tell a friend feature from tell_a_friend.php require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_TELL_A_FRIEND); if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'process')) { $error = false; $to_email_address = tep_db_prepare_input($HTTP_POST_VARS['to_email_address']); $to_name = tep_db_prepare_input($HTTP_POST_VARS['to_name']); $from_email_address = tep_db_prepare_input($HTTP_POST_VARS['from_email_address']); $from_name = tep_db_prepare_input($HTTP_POST_VARS['from_name']); $message = tep_db_prepare_input($HTTP_POST_VARS['message']); if (empty($from_name)) { $error = true; $messageStack->add('friend', ERROR_FROM_NAME); } if (!tep_validate_email($from_email_address)) { $error = true; $messageStack->add('friend', ERROR_FROM_ADDRESS); } if (empty($to_name)) { $error = true; $messageStack->add('friend', ERROR_TO_NAME); } // Mail a (silent) report to the web owner: // 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 .= "\n\n" . '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: ' . "\n\n" . $HTTP_POST_VARS['yourmessage']; $report .= "\n\n" . '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 protected], '[ REPORT ] Tell a Friend Usage', stripslashes($report), '', $from_email_address); if (!tep_validate_email($to_email_address)) { $error = true; $messageStack->add('friend', ERROR_TO_ADDRESS); } if ($error == false) { And here are the results of the email she receives.. ----- Original Message ----- From: <[email protected]> To: "Tell A Friend" <[email protected]> Sent: Saturday, August 12, 2006 10:36 AM Subject: [ REPORT ] Tell a Friend Usage > > Here are the details of the T.A.F. submission by Toni on Sat Aug 12 > 10:36:25 2006: > > Recipient details: - > Sender details: Toni - myemailaddress.com > Sender ip address: 00.000.000.000 > Personal message: > > > > Product link: > http://xxxxxx.com/~xxx/shop/product_info.php?products_id=151 ~~~Any suggestions on what to change in the code to make the recipient details to show? Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.