Contributions
Review Notification
This is a simple modification that will send an email when a new review has been written. It should work whether you have the Review Approval mod installed or not.
The recipient of the email is designated via the admin control panel
Expand All / Collapse All
Minor changes:
Changed output to show product's name as well as the model number.
Cleaned output format.
Cleaned the installation instructions which were confusing and had retained remnants of obsolete instruction.
No download required; the text below is the full mod. All credit goes to the original author(s).
-----------------------------------------------
INSTALLATION:
1) Backup the file: catalog/product_reviews_write.php as it's the only file you will need to change.
2) In catalog/product_reviews_write.php (at or near line 30), find:
$customer_query = tep_db_query("select customers_firstname, customers_lastname from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$customer_id . "'");
*** Replace with:
// notify by email mod replacement
// $customer_query = tep_db_query("select customers_firstname, customers_lastname from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$customer_id . "'");
$customer_query = tep_db_query("select c.customers_firstname, c.customers_lastname, c.customers_email_address, a.entry_company from " . TABLE_CUSTOMERS . " c LEFT JOIN " .TABLE_ADDRESS_BOOK. " a ON a.customers_id = c.customers_id where c.customers_id = '" . (int)$customer_id . "'");
// end of notify by email mod replacement
3) In the same file, just after this line (at or near line 65):
tep_db_query("insert into " . TABLE_REVIEWS_DESCRIPTION . " (reviews_id, languages_id, reviews_text) values ('" . $insert_id . "', '" . $languages_id . "', '" . $HTTP_POST_VARS['review'] . "')");
*** ADD the following:
// notify by email mod insertion
$email_notify_body =
'A new review has been submitted by: '."n".
'Name: '. $customer['customers_firstname'] . " " . $customer['customers_lastname']."n".
"Company: ".$customer['entry_company']."n".
"Email: " .$customer['customers_email_address']."nn".
"----------------------------------------------"."n".
"Product: " .$product_info['products_name']."n".
"Model: " .$product_info['products_model']."n".
"Review Text:"."n".
$review."n"
;
tep_mail('', STORE_OWNER_EMAIL_ADDRESS, '*** New Review',$email_notify_body, '',STORE_OWNER_EMAIL_ADDRESS , '');
// end of notify by email mod insertion
4) Test it! You're done!
-----------------------------------------------
Remember, even though this is a simple fix you should ALWAYS BACKUP YOUR FILES FIRST!
On review adding, sends an detailed email to shop admin.
The email contains:
- name
- email
- company
- review product model
- full text of review
I made a few small changes to this cotribution in order for it to actually show the customers' name, and to simplify the installation. All credit goes to Dave Ferrise for the original contribution.
In this version, no SQL has to be run, and your database remains unchanged. e-mails will be sent to the address you specified in admin--> My Store --> E-Mail Address.
This is a simple modification that will send an email when a new review has been written. It should work whether you have the Review Approval mod installed or not.
The recipient of the email is designated via the admin control panel
Note: Contributions are used at own risk.