Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

changing customer email content


web-connected

Recommended Posts

I have combed through endless lines of code and 44 pages of the forum and I cannot find the answer I am looking for. I am sorry this may be a duplicate, but does anyone know how to change the content of the emails sent to customers through out the order process. I would simply like to edit a few lines of text. Any help would be greatly appreciated.

 

Have tried every possible file and even looked in the DB and I cannot find it. Am I really that blind?

 

Thanks in Advance,

John

Link to comment
Share on other sites

In checkout_process.php is the email from the order. Now I am a bit dimm ... so I like to break down the code line by line, which is not the *efficient* way to write it ... but it is comprehensible ... :D

 

// lets start with the email confirmation

 $email_order = STORE_NAME . "n" .

                EMAIL_SEPARATOR . "n" .

                EMAIL_TEXT_ORDER_NUMBER . ' ' . $insert_id . "n" .

                EMAIL_TEXT_INVOICE_URL . '  ' . tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $insert_id, 'SSL', false) . '  ' . "n" .

                EMAIL_TEXT_DATE_ORDERED . ' ' . strftime(DATE_FORMAT_LONG) . "nn";

 if ($order->info['comments']) {

   $email_order .= $order->info['comments'] . "nn";

 }

 $email_order .= EMAIL_TEXT_PRODUCTS . "n" .

                 EMAIL_SEPARATOR . "n" .

                 $products_ordered .

                 EMAIL_SEPARATOR . "n";



 $size = sizeof($order_totals);

 for ($i=0; $i<$size; $i++) {

   $email_order .= strip_tags($order_totals[$i]['title']) . ' ' . strip_tags($order_totals[$i]['text']) . "n";

 }



 $email_order .= "n" . EMAIL_TEXT_DELIVERY_ADDRESS . "n" .

                 EMAIL_SEPARATOR . "n" .

                 tep_address_label($customer_id, $sendto, 0, '', "n") . "nn" .

                 EMAIL_TEXT_BILLING_ADDRESS . "n" .

                 EMAIL_SEPARATOR . "n" .

                 tep_address_label($customer_id, $billto, 0, '', "n") . "nn";

 if (is_object($$payment)) {

   $email_order .= EMAIL_TEXT_PAYMENT_METHOD . "n" .

                   EMAIL_SEPARATOR . "n";

   $payment_class = $$payment;

   $email_order .= $payment_class->title . "nn";

   if ($payment_class->email_footer) {

     $email_order .= $payment_class->email_footer . "nn";

   }

 }

// WebMakers.com Added: Include Order # in Subject

 tep_mail($order->customer['firstname'] . ' ' . $order->customer['lastname'], $order->customer['email_address'],

 EMAIL_TEXT_SUBJECT . ' #' . $insert_id,

 nl2br($email_order),

 STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, '');



// send emails to other people

 if (SEND_EXTRA_ORDER_EMAILS_TO != '') {

// WebMakers.com Added: Include Order # in Subject and customer's email address and phone in body

   tep_mail('', SEND_EXTRA_ORDER_EMAILS_TO,

   EMAIL_TEXT_SUBJECT . ' #' . $insert_id,

   $order->customer['firstname'] . ' ' . $order->customer['lastname'] . ' ' . $order->customer['email_address'] . "nn" .

   'Telephone ' . $order->customer['telephone'] . "nn" .

   nl2br($email_order),

   STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, '');

 }

 

Then, go peek in /admin/orders.php I did not break this done nice and neat as I have few changes to it:

 

 

 

        $customer_notified = '0';

       if ($HTTP_POST_VARS['notify'] == 'on') {

         $notify_comments = '';

         if ($HTTP_POST_VARS['notify_comments'] == 'on') {

           $notify_comments = sprintf(EMAIL_TEXT_COMMENTS_UPDATE, $comments) . "nn";

         }

         $email = STORE_NAME . "n" . EMAIL_SEPARATOR . "n" . EMAIL_TEXT_ORDER_NUMBER . ' ' . $oID . "n" . EMAIL_TEXT_INVOICE_URL . ' ' . tep_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, 'order_id=' . $oID, 'SSL') . "n" . EMAIL_TEXT_DATE_ORDERED . ' ' . tep_date_long($check_status['date_purchased']) . "nn" . sprintf(EMAIL_TEXT_STATUS_UPDATE, $orders_status_array[$status]);

         tep_mail($check_status['customers_name'], $check_status['customers_email_address'], EMAIL_TEXT_SUBJECT . ' #' . $oID, nl2br($email), STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

         $customer_notified = '1';

       }

 

See if that helps you out ... :D

Link to comment
Share on other sites

Thanks, Linda. Here is exactly what I am trying to do. I wouold like to change the text of the email (I am sure it has to be buried in there somewhere). Right now here is the email that is being sent after and order is submitted:

 

STATEAMIND WATERSPORTS

------------------------------------------------------

Order Number: 18

Detailed Invoice: https://stateami.securesites.com/catalog/ac...php?order_id=18

Date Ordered: Friday 06 December, 2002

 

Products

------------------------------------------------------

1 x Jacket Series Mainlines (hl-37150050) = $99.99

------------------------------------------------------

Sub-Total: $99.99

Tax (7.075%): $7.07

UPS GND 1 X 5.5: $11.53

Total: $118.59

 

Delivery Address

------------------------------------------------------

John Pretti

 

Payment Method

------------------------------------------------------

Cash on Delivery

 

I would like to make it say the following:

 

STATEAMIND WATERSPORTS

 

Thank you for your order. You is being processed pending credit approval. Any questions email proshop@stateamind.com.

 

------------------------------------------------------

Order Number: 18

Detailed Invoice: https://stateami.securesites.com/catalog/ac...php?order_id=18

Date Ordered: Friday 06 December, 2002

 

Products

------------------------------------------------------

1 x Jacket Series Mainlines (hl-37150050) = $99.99

------------------------------------------------------

Sub-Total: $99.99

Tax (7.075%): $7.07

UPS GND 1 X 5.5: $11.53

Total: $118.59

 

Delivery Address

------------------------------------------------------

John Pretti

 

Payment Method

------------------------------------------------------

Cash on Delivery

 

As you can see I just want to add some simple text. In the process emails I know there is some static text I would like to change as well.

 

Please let me know if this is possible and which file(s) I need to edit.

 

 

Thanks,

John

Link to comment
Share on other sites

just looked in that file how do you add txt to it then everythings defined!

 

<?php

/*

 $Id: checkout_process.php,v 1.26 2002/11/01 04:22:05 hpdl Exp $



 osCommerce, Open Source E-Commerce Solutions

 http://www.oscommerce.com



 Copyright (c) 2002 osCommerce



 Released under the GNU General Public License

*/



define('EMAIL_TEXT_SUBJECT', 'Order Process');

define('EMAIL_TEXT_ORDER_NUMBER', 'Order Number:');

define('EMAIL_TEXT_INVOICE_URL', 'Detailed Invoice:');

define('EMAIL_TEXT_DATE_ORDERED', 'Date Ordered:');

define('EMAIL_TEXT_PRODUCTS', 'Products');

define('EMAIL_TEXT_SUBTOTAL', 'Sub-Total:');

define('EMAIL_TEXT_TAX', 'Tax:        ');

define('EMAIL_TEXT_SHIPPING', 'Shipping: ');

define('EMAIL_TEXT_TOTAL', 'Total:    ');

define('EMAIL_TEXT_DELIVERY_ADDRESS', 'Delivery Address');

define('EMAIL_TEXT_BILLING_ADDRESS', 'Billing Address');

define('EMAIL_TEXT_PAYMENT_METHOD', 'Payment Method');



define('EMAIL_SEPARATOR', '------------------------------------------------------');

define('TEXT_EMAIL_VIA', 'via');

?>

 

Just want to change what the email says so when i change the status of the order to Delivered instead of saying you items now delivered i want it has been despatced and will be with you today or tomorrow

Link to comment
Share on other sites

just looked in that file how do you add txt to it then everythings defined!

 

 

Just want to change what the email says so when i change the status of the order to Delivered instead of saying you items now delivered i want it has been despatced and will be with you today or tomorrow

 

In the catalogincludeslanguagesenglishcheckout_process.php, add the following line:

 

define('EMAIL_CUSTOM_HEADER', '<insert your own text here>');

 

Then in the file catalogcheckout_process.php add it in whereever you want

 

Example:

Original code for the email header

// lets start with the email confirmation

 $email_order = STORE_NAME . "n" . 

                EMAIL_SEPARATOR . "n" . 

                EMAIL_TEXT_ORDER_NUMBER . ' ' . $insert_id . "n" .

                EMAIL_TEXT_INVOICE_URL . ' ' . tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $insert_id, 'SSL', false) . "n" .

                EMAIL_TEXT_DATE_ORDERED . ' ' . strftime(DATE_FORMAT_LONG) . "nn";

 if ($order->info['comments']) {

New email header with your statement in it:

// lets start with the email confirmation

 $email_order = STORE_NAME . "n" . 

                EMAIL_CUSTOM_HEADER . "n" .

                EMAIL_SEPARATOR . "n" . 

                EMAIL_TEXT_ORDER_NUMBER . ' ' . $insert_id . "n" .

                EMAIL_TEXT_INVOICE_URL . ' ' . tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $insert_id, 'SSL', false) . "n" .

                EMAIL_TEXT_DATE_ORDERED . ' ' . strftime(DATE_FORMAT_LONG) . "nn";

 if ($order->info['comments']) {

 

You can add any definitions you want, and then use them wherever you want to.

 

Aodhan

Link to comment
Share on other sites

just looked in that file how do you add txt to it then everythings defined!

 

Just want to change what the email says so when i change the status of the order to Delivered instead of saying you items now delivered i want it has been despatced and will be with you today or tomorrow

 

Oops... :oops:

 

We've all been pointing you to the confirmation email sent when a customer first orders something.

 

The files you want are adminorder.php, and adminincludeslanguagesenglishorder.php

 

Same thing, add your own definition to the included order.php file, and then you will need to change the code in orders.php slightly

 

        $customer_notified = '0';

       if ($HTTP_POST_VARS['notify'] == 'on') {

         $email = STORE_NAME . "n" . EMAIL_SEPARATOR . "n" . EMAIL_TEXT_ORDER_NUMBER . ' ' . $oID . "n" . EMAIL_TEXT_INVOICE_URL . ' ' . tep_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, 'order_id=' . $oID, 'SSL') . "n" . EMAIL_TEXT_DATE_ORDERED . ' ' . tep_date_long($check_status['date_purchased']) . "nn" . sprintf(EMAIL_TEXT_STATUS_UPDATE, $orders_status_array[$status]);

         tep_mail($check_status['customers_name'], $check_status['customers_email_address'], EMAIL_TEXT_SUBJECT, nl2br($email), STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

         $customer_notified = '1';

       }

 

Basically, after the notify check (if $HTTP_POST-VARS['notify'] == 'on'), you will need another if statement. Something along the lines of

if (order_type is delivered)

send email with custom header

else

send regular email

endif

 

That will change it for you.

 

Aodhan

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...