Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

how to adding customers' email address to extra order E-mail


gkbutts

Recommended Posts

Can some one tell me what I need to do to change the format of the extra order e-mails that are sent. Every time a customer purchase a product from me I have to send an E-Mail to a third party for processing. They need the information in the email in a certain format. Thay also need my customers E-mail which does not get sent.

here is how I need to send them the email.

 

example:

NAME:John Doe

ADDRESS:123 N. Main St.

CITY:Los Angeles

STATE:Californa

ZIP:90055

COUNTRY:USA

EMAIL:[email protected]

DOWNLOAD PRODUCT:mcc5456

DOWNLOAD PRODUCT:sim3854

DOWNLOAD PRODUCT:but3228

 

Thanks for any help.

Link to comment
Share on other sites

This might take several iterations to get right, so for now we'll just send it to you.

 

After we get it like you want it, I'll show you how to alter it to send it to someone else.

 

MAKE A BACKUP OF THIS FILE BEFORE MAKING ANY EDITS!!!

 

In checkout_process.php, find this code:

 

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

After it, ADD this code:

 

//
// code added 02/08/08
//
$email_order = 'NAME:' . $order->customer['firstname'] . ' ' . $order->customer['lastname'] . "\n";
$email_order .= 'ADDRESS:' . $order->customer['street_address'] . "\n";
$email_order .= 'CITY:' . $order->customer['city'] . "\n";
$email_order .= 'STATE:' . $order->customer['state'] . "\n";
$email_order .= 'ZIP:' . $order->customer['postcode'] . "\n";
$email_order .= 'COUNTRY:' . $order->customer['country']['title'] . "\n";
$email_order .= 'EMAIL:' . $order->customer['email_address'] . "\n";

for ($i=0, $n=sizeof($order->products); $i<$n; $i++) {
 $email_order .= 'DOWNLOAD PRODUCT:' . $order->products[$i]['name'] . "\n";
}

tep_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, '3rd Party Email Test', $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

//
// end of added code
//

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...