Tell-A-Friend Form Email EditsLast Update: 15th July, 2005
Article ID: 199



Introduction

The Tell-A-Friend form email is sent when a customer wants to inform someone else about one of your products. When a product in the store is clicked the Tell-A-Friend form is activated and made available for use in the left column of the store. This form can be sent to the store owner when used by a customer to see who was notified.


Tell-A-Friend Form Edit

To edit the content of the email you need to look in the following file.

catalog/includes/languages/*your language*/tell_a_friend.php


The sections of the file that handle the content of the email are:

define('TEXT_EMAIL_SUCCESSFUL_SENT', 'Your email about <b>%s</b> has been successfully sent to <b>%s</b>.');
define('TEXT_EMAIL_SUBJECT', 'Your friend %s has recommended this great product from %s');
define('TEXT_EMAIL_INTRO', 'Hi %s!' . "nn" . 'Your friend, %s, thought that you would be interested in %s from %s.');
define('TEXT_EMAIL_LINK', 'To view the product click on the link below or copy and paste the link into your web browser:' . "nn" . '%s');
define('TEXT_EMAIL_SIGNATURE', 'Regards,' . "nn" . '%s');



Add Store Owner Email to Form

[note]To add the store owner to the form to receive an additional email when submitted open /catalog/tell_a_friend.php about line 80 after this code:

tep_mail($to_name, $to_email_address, $email_subject, $email_body, $from_name, $from_email_address);

?>



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['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', 'you@youraddress.com', '[ REPORT ] Tell a Friend Usage', stripslashes($report), '', $from_email_address);



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>"

 

 

Trademark Policy | Copyright Policy | Sitemap

Copyright © 2000-2005 osCommerce. All rights reserved.