Jump to content


Corporate Sponsors


Latest News: (loading..)

- - - - -

How to add text to order confirmation e-mail?


69 replies to this topic

#61 PP46

  • Community Member
  • 3 posts
  • Real Name:Philip Payne
  • Gender:Male

Posted 28 November 2011, 12:39

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

Quote

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

#62 14steve14

  • Community Member
  • 2,171 posts
  • Real Name:Steve
  • Gender:Male

Posted 28 November 2011, 17:40

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
I am not a coder. OSC has a steep learning curve, but in general the program does work. If it doesnt work, the chances are it is something you have done.

#63 RunBike7518

  • Community Member
  • 4 posts
  • Real Name:Michael Engberson

Posted 29 November 2011, 04:48

How do I change the order process email FROM address to the customer's email, not the store owner's (my) email? This would make contacting the customer much easier by just replying to the order email.

#64 Monika in Germany

  • Community Member
  • 4,860 posts
  • Real Name:Monika
  • Gender:Female
  • Location:Frankfurt, Germany

Posted 29 November 2011, 08:04

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

right now you should be having something like this



Quote

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)



Quote

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

#65 PP46

  • Community Member
  • 3 posts
  • Real Name:Philip Payne
  • Gender:Male

Posted 29 November 2011, 17:57

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


#66 14steve14

  • Community Member
  • 2,171 posts
  • Real Name:Steve
  • Gender:Male

Posted 29 November 2011, 18:00

I expect you have received an order confirmation email as you as a customer that bought something, and the other email is from the extra order email to the store owner.
REMEMBER BACKUP, BACKUP AND BACKUP
I am not a coder. OSC has a steep learning curve, but in general the program does work. If it doesnt work, the chances are it is something you have done.

#67 RunBike7518

  • Community Member
  • 4 posts
  • Real Name:Michael Engberson

Posted 29 November 2011, 18:22

View PostMonika in Germany, on 29 November 2011, 08:04, said:

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.

Edited by RunBike7518, 29 November 2011, 18:23.


#68 PP46

  • Community Member
  • 3 posts
  • Real Name:Philip Payne
  • Gender:Male

Posted 29 November 2011, 18:32

Thanks 14steve14
I expect that is the answer
[img]http://forums.oscommerce.com//public/style_emoticons/default/thumbsup.gif[/img]

#69 Curley61

  • Community Member
  • 87 posts
  • Real Name:Paul
  • Gender:Male
  • Location:Whiting, KS

Posted 04 February 2012, 00:48

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
Paul 'n NE Kansas

#70 Curley61

  • Community Member
  • 87 posts
  • Real Name:Paul
  • Gender:Male
  • Location:Whiting, KS

Posted 04 February 2012, 02:49

View PostCurley61, on 04 February 2012, 00:48, said:

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.
Paul 'n NE Kansas