PDA

View Full Version : Tell a Friend Box??



Kristine
04-04-2004, 09:08 AM
why is there a text input? It doesn't do anything, when you click the mail icon you still have to enter the friends email address again? How can I get that outta there?

Kristine
04-11-2004, 06:58 AM
I finally got it to work! I also added a little more to it if anyone is interested.
First off I fixed the problem of the text input box not working.
You can either have it carry forward the name of your friend or the friends email address. I have mine carrying the email address to the next page:
In catalog/includes/boxes find this:

text' => tep_draw_input_field('send_to', '', 'size="10"') . ' ' . tep_image_submit('button_tell_a_friend.gif', BOX_HEADING_TELL_A_FRIEND) . tep_draw_hidden_field('products_id', $HTTP_GET_VARS['products_id']) . tep_hide_session_id() . '<br>' . BOX_TELL_A_FRIEND_TEXT);

change 'send_to' to 'to_email_address'

You could also change it to 'to_name'

I found this in the wiki docs, whenever someone uses the tell a friend, it sends you a copy.

In catalog/tell_a_friend.php
find: around line 80

tep_mail($to_name, $to_email_address, $email_subject, $email_body, $from_name, $from_email_address); ?>
After that put this:


//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['to_name'] . ' - ' . $HTTP_POST_VARS['to_email_address']; $report .= "\n" . 'Sender details: ' . $from_name . ' - ' . $from_email_address; $report .= "\n" . 'Sender ip address: ' . $ip; $report .= "\n" . 'Personal message: ' . "\n\n" . $HTTP_POST_VARS['message']; $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', 'you@youraddress.com', '[ REPORT ] Tell a Friend Usage', stripslashes($report), '', $from_email_address);

I had to change the code a little from the original because it was not giving me all the detail it should. The original is here http://wiki.oscommerce.com/docsCatEmailFriend

Change you@youraddress.com to your email address.
Note that if you use MIME e-mail you should change all occurances of "\n" to "<br>"

Anonymous
04-26-2004, 08:31 PM
Kristine ~

I seem to be having one of those days, (again;~) I implemented your addition to the TAF script and it works fine on the recipient side, but I'm having a heck of a time getting it to send me a report.

I've tried several valid emails, (yes, including my admin email;-) and I still get no report.

Did you have any issues like this? If so, any hints as to the resolution?

Dave

(BTW, thanks for all your "other" input. You ask the right ?'s)

DaveF
04-26-2004, 08:39 PM
Oops - My log-in had timed out. Dave

Kristine
05-03-2004, 05:19 AM
I'm sorry I didn't notice this reply till now.
I didn't have any problems, it sent me the report right from the start. I'm not sure what your problem might be.

(BTW, thanks for all your "other" input. You ask the right ?'s)

Well I guess if you ask enough, you're bound to ask the right ones! LOL