Jump to content


Corporate Sponsors


Latest News: (loading..)

- - - - -

Add customer last name near top of conf e-mail


5 replies to this topic

#1 knifeman

  • Community Member
  • 1,537 posts
  • Real Name:Tim
  • Gender:Male

Posted 14 September 2011, 12:56

I know there are tons of threads on this subject, but i just cannot get it right.

I want to add my customer name right above the STORE NAME in the confirmation e-mail. Preferably first and last name. I am making my attempts with just the last name right now. My first few tries gave fatal errors. After much searching, I came up with this:
// lets start with the email confirmation
  $email_order .= tep_db_output($order->customer['lastname']) . "\n\n";
  $email_order = STORE_NAME . "\n" .
				 EMAIL_SEPARATOR . "\n" .
No error with this, but no text either. Can someone please show me how this should be done?

Tim

#2 multimixer

  • Community Sponsor
  • 3,595 posts
  • Real Name:George Zarkadas
  • Gender:Male
  • Location:Greece

Posted 14 September 2011, 14:14

Try this
// lets start with the email confirmation
  $email_order = 'Any text you want to add' .  tep_db_output($order->customer['lastname']) . "\n\n";
  $email_order .= STORE_NAME . "\n" .

Looking for a way to create your own osCommerce template ? click

#3 knifeman

  • Community Member
  • 1,537 posts
  • Real Name:Tim
  • Gender:Male

Posted 14 September 2011, 14:35

Thanks George,

I will try it. I have this working, but it is lower than i originally wanted.
// lets start with the email confirmation
  $email_order = STORE_NAME . "\n" .
				 EMAIL_TEXT_ORDER_NUMBER . ' ' . $insert_id . "\n" .
				 EMAIL_TEXT_DATE_ORDERED . ' ' . strftime(DATE_FORMAT_LONG) . "\n\n";
$email_order .= tep_db_output($order->customer['lastname']) . "\n\n";
  if ($order->info['comments']) {


#4 multimixer

  • Community Sponsor
  • 3,595 posts
  • Real Name:George Zarkadas
  • Gender:Male
  • Location:Greece

Posted 14 September 2011, 15:57

The issue is the "." (dot) before the "="

Example

$kuku = 'hello';
$kuku = 'world';

echo $kuku ; gives hello


$kuku = 'hello';
$kuku .= 'world';

echo $kuku ; gives hello world
Looking for a way to create your own osCommerce template ? click

#5 knifeman

  • Community Member
  • 1,537 posts
  • Real Name:Tim
  • Gender:Male

Posted 14 September 2011, 16:36

I understand it now. Thanks!

Tim

#6 forummaker

  • Community Member
  • 95 posts
  • Real Name:Ken
  • Gender:Male
  • Location:USA

Posted 09 February 2012, 21:04

Same question... but I'm using 2.2
Here is where I would like to add the customers first name with the email order update
$email = 'CUSTOMERS FIRST NAME HERE' . "\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]);
This is from my admin/orders.php
Any help would be greatly appreciated... as I've been trying different combinations of code to pull the customers first name from... with no avail.
Thanks.
That "Can" you're about to open... has worms!
Don't say I didn't worn ya.
n. pl. cans of worms Informal - A source of unforeseen and troublesome complexity.