Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

How to add text to order confirmation e-mail?


Guest

Recommended Posts

I am trying to edit the auto response after the status of the order has changed. I went into languages/english/orders.php to change it. I think the following code is what I need to adjust, but I'm not sure how to change the "\n\n"

 

Code:

define('EMAIL_TEXT_STATUS_UPDATE', 'Your order has been updated to the following status.' . "\n\n" . 'New status: %s' . "\n\n" . 'Please reply to this email if you have any questions.' . "\n");

define('EMAIL_TEXT_COMMENTS_UPDATE', 'The comments for your order are' . "\n\n%s\n\n");

 

 

I want to adjust the "n\n" which I think is the text stating that the order has been delivered. I'd like it to say, your order has been shipped.

 

Thanks

Link to comment
Share on other sites

  • Replies 69
  • Created
  • Last Reply

All the "\n" does is perform a "newline" in ther email.

 

Text right after a "\n" begins on a new line.

 

I think you'll need to mak an edit in "\admin\orders.php".

 

I know where:

 

			$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']) . "\n\n" . $notify_comments . sprintf(EMAIL_TEXT_STATUS_UPDATE, $orders_status_array[$status]);
// we'll probably need the change here
		tep_mail($check_status['customers_name'], $check_status['customers_email_address'], EMAIL_TEXT_SUBJECT, $email, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

I'm just not sure exactly when.

 

How many "status" changes does an order go thru?

:unsure:

 

And at which point do you want the text change made?

:unsure:

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

  • 2 weeks later...
It should add the name of the store to the subject when you change this in

the checkout_process.php file:

 

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

 

 

I have done this and it adds the store name correctly, but there is no space between Order Process and Store name i.e

 

Order ProcessStore Name

 

How do I get the space?

 

Thanks

 

Lotti

Link to comment
Share on other sites

In this code:

 

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

Are you certain you have a " " (space) AFTER the word Process but BEFORE the ' (single tick mark)?

:unsure:

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

In this code:

 

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

Are you certain you have a " " (space) AFTER the word Process but BEFORE the ' (single tick mark)?

:unsure:

 

Doh!

Link to comment
Share on other sites

I hope that means you have your problem solved.

:blush:

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

  • 1 month later...

Hi Guys,

 

I've been looking for a contribution that changes the order confirmation e-mail to be in the format that you might expect from "Fancier Invoice & Packingslip v1.0" http://www.oscommerce.com/forums/index.php?sho...&hl=invoice. The whole text format of the e-mail systems looks terrible in my opinion. Does anyone know of a suitable contribution that impove the professional look of the Order Process emails?

 

Thanks,

Aidan.

Link to comment
Share on other sites

  • 2 weeks later...

Hi, since i've some items in my shops that has the same name, i'd like to place, in the confirm email and and in the order, the name of the product purchased and the name of the manufacturers.

Has anyone already solved this matter?

Thanks

Link to comment
Share on other sites

  • 1 month later...

Along the line: I would like to add "reply-to" function to the order email that is sent to the shop owner. So many times I just hit "reply" just to email myself to thank for the order :)

 

Anybody can help?

Link to comment
Share on other sites

  • 2 years later...

this is what i did:

 

catalog/checkout_process.php: (from the line '//lets start.....'

 

// 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) . "\n\n";
 if ($order->info['comments']) {
   $email_order .= tep_db_output($order->info['comments']) . "\n\n";
 }
 $email_order .= EMAIL_TEXT_PRODUCTS . "\n" . 
                 EMAIL_SEPARATOR . "\n" . 
                 $products_ordered . 
                 EMAIL_SEPARATOR . "\n";

 for ($i=0, $n=sizeof($order_totals); $i<$n; $i++) {
   $email_order .= strip_tags($order_totals[$i]['title']) . ' ' . strip_tags($order_totals[$i]['text']) . "\n";
 }

 if ($order->content_type != 'virtual') {
   $email_order .= "\n" . EMAIL_TEXT_DELIVERY_ADDRESS . "\n" . 
                   EMAIL_SEPARATOR . "\nemail: " .$order->customer['email_address']. "\nTelephone: ".$order->customer['telephone']."\n".
                   tep_address_label($customer_id, $sendto, 0, '', "\n") . "\n";
 }

 $email_order .= "\n" . EMAIL_TEXT_BILLING_ADDRESS . "\n" .
                 EMAIL_SEPARATOR . "\nemail: " .$order->customer['email_address']. "\nTelephone: ".$order->customer['telephone']."\n".
                 tep_address_label($customer_id, $billto, 0, '', "\n") . "\n\n";
     
 if (is_object($$payment)) {
   $email_order .= EMAIL_TEXT_PAYMENT_METHOD . "\n" . 
                   EMAIL_SEPARATOR . "\n";
   $payment_class = $$payment;
   $email_order .= $payment_class->title . "\n\n";
   if ($payment_class->email_footer) { 
     $email_order .= $payment_class->email_footer . "\n\n";
   }
 }

 tep_mail($order->customer['firstname'] . ' ' . $order->customer['lastname'], $order->customer['email_address'], EMAIL_TEXT_SUBJECT." order:".$insert_id, $email_order, 

STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

 

catalog/includes/languages/english/checkout_process.php: (everything)

 

<?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',  ' - Your Order from ' . STORE_NAME);
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');
?>

 

this will result in the following:

 

Subject: - Your Order from Costless Vitamin order:15 (subject line of email)

 

Costless Vitamin

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

Order Number: 15

 

Detailed Invoice:

https://www.costlessvitamin.com/catalog/acc...php?order_id=15

 

Date Ordered: Wednesday 12 January, 2005

 

Products

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

1 x Wobenzym N 800 Tablets (wobenzym800) = $77.99

Coating Clear Coating

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

Sub-Total: $77.99

UPS Ground (UPS): $7.99

Total: $85.98

 

Delivery Address

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

email: [email protected]

Telephone: 0800-customers-phone-no-555

Customers Name

13422 Wright Dr

Guerneville, CA 94432

United States

 

Billing Address

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

email: [email protected]

Telephone: 0800-customers-phone-no-555

Customers Name

13422 Wright Dr

Guerneville, CA 94432

United States

 

Payment Method

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

Payflow Pro

 

 

 

hope this helps!

 

:blink:

This works well. How do I add my own line to it? If I add

define ('EMAIL_TEXT_MYOWNTEXT',  ' - Your Order from ' . MY_OWNTEXT);

to checkout_process.php where (in which files) do I put the rest to make it working?

Link to comment
Share on other sites

  • 1 year later...

Hello

In order to add the phone number to the email confirmation

 

I have modified checkout_process.php

accordin to gameparts post

 

this code

 

if ($order->content_type != 'virtual') {
$email_order .= "\n" . EMAIL_TEXT_DELIVERY_ADDRESS . "\n" .
EMAIL_SEPARATOR . "\n" .
tep_address_label($customer_id, $sendto, 0, '', "\n") . "\n";
}

 

changed to

 

if ($order->content_type != 'virtual') {
$email_order .= "\n" . EMAIL_TEXT_DELIVERY_ADDRESS . "\n" .
EMAIL_SEPARATOR . "\n" .
EMAIL_TEXT_MAIL . $order->customer['email_address'] . "\n" .
EMAIL_SEPARATOR . "\n" .
tep_address_label($customer_id, $sendto, 0, '', "\n") .
EMAIL_TEXT_PHONE . $order->customer['telephone']. "\n";
}

 

 

This works for me

only I have the phone number on the same line as country

like this

Mike Brown

Penny Lane

Manchester 215485

UNITED KINGDOMTelephone: 0912458575

 

 

I would like to place a <br> somewhere

Normaly it works in the language file but not in this case.??!

 

can somebody tell me how to do this please

 

Thanks

Link to comment
Share on other sites

Can you nott just add another

 

EMAIL_SEPARATOR . "\n" .

 

between the code you added and the line above so it would look something like

 

if ($order->content_type != 'virtual') {

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

EMAIL_SEPARATOR . "\n" .

EMAIL_TEXT_MAIL . $order->customer['email_address'] . "\n" .

EMAIL_SEPARATOR . "\n" .

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

EMAIL_SEPARATOR . "\n" .

EMAIL_TEXT_PHONE . $order->customer['telephone']. "\n";

}

REMEMBER BACKUP, BACKUP AND BACKUP

Link to comment
Share on other sites

you would do that in the extra order email section of your checkout_process file.

 

right now you should be having something like this

 

 

 

tep_mail($order->customer['firstname'] . ' ' . $order->customer['lastname'], $order->customer['email_address'], EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

 

// send emails to other people

if (SEND_EXTRA_ORDER_EMAILS_TO != '') {

tep_mail('', SEND_EXTRA_ORDER_EMAILS_TO, EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

}

 

 

change it to this (only extra order info part modified)

 

 

 

tep_mail($order->customer['firstname'] . ' ' . $order->customer['lastname'], $order->customer['email_address'], EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

 

// send emails to other people

if (SEND_EXTRA_ORDER_EMAILS_TO != '') {

tep_mail('', SEND_EXTRA_ORDER_EMAILS_TO, EMAIL_TEXT_SUBJECT, $email_order, $order->customer['firstname'] . ' ' . $order->customer['lastname'], $order->customer['email_address']);

}

:-)

Monika

 

addicted to writing code ... can't get enough of databases either, LOL!

 

my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum

 

Interactive Media Award July 2007 ~ category E-Commerce

my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ...

Link to comment
Share on other sites

Thank you 14steve14

 

that was what I needed !!

 

I do not know if its a coincidence but

as I just did a test sale

with my card..

I received 2 confirmation mails from the site

(oscommerce mailer)

I checked the bank and I was debited only once though

could be a glitch ..

 

anyhow here is the code modified I can not see

what this would have changed ?!

 

if ($order->content_type != 'virtual') {
$email_order .= "\n" . EMAIL_TEXT_DELIVERY_ADDRESS . "\n" .
EMAIL_SEPARATOR . "\n" .
EMAIL_TEXT_MAIL . $order->customer['email_address'] . "\n" .
EMAIL_SEPARATOR . "\n" .
tep_address_label($customer_id, $sendto, 0, '', "\n") .
EMAIL_SEPARATOR . "\n" .
EMAIL_TEXT_PHONE . $order->customer['telephone']. "\n";
}

 

Link to comment
Share on other sites

you would do that in the extra order email section of your checkout_process file.

 

right now you should be having something like this

 

 

 

 

 

 

change it to this (only extra order info part modified)

 

Thank you Monika! The customer's email is now appearing as the FROM address for order emails.

Link to comment
Share on other sites

  • 2 months later...

I would also like to add text. What I want to do is too add my phone number, but only to the customers that use a credit/debit card through authorize.net. I would like a phone number and personal message to appear at the bottom of the email the customer receives, right after the payment type is listed. I would like the message to say something similar to "For any problems or questions about your order, please call ***-***-****."

 

Any help would be appreciated.

 

Thank you,

Paul

Link to comment
Share on other sites

I would also like to add text. What I want to do is too add my phone number, but only to the customers that use a credit/debit card through authorize.net. I would like a phone number and personal message to appear at the bottom of the email the customer receives, right after the payment type is listed. I would like the message to say something similar to "For any problems or questions about your order, please call ***-***-****."

 

Any help would be appreciated.

 

Thank you,

Paul

 

I finally solved my own problem after a lot of online searching....

 

I defined EMAIL_TEXT_TELEPHONE in english/checkout_process.php.

 

Then in catalog/checkout_process I added this line

 if ($order->info['payment_method']=="Authorize.net Credit Card AIM")
   $email_order .= EMAIL_TEXT_TELEPHONE . "\n\n";

 

It works like a charm.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...