Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Add site logo to outgoing emails


zalik22

Recommended Posts

Posted

Hi,

 

I would like to add my site logo to all outgoing email. Is there a way to do this without installing a contribution? I searched for about 30 minutes but did not have any luck (all posts were either unanswered or led to a contribution). I want the logo to appear at the top of all my emails. What files would I have to change and what area would I have to paste the code? I appreciate your help.

 

Thanks!

Posted

I am in admin.orders.php and here is my code:

 

 

$email = <img src="http://www.mysite.com/catalog/images/oscommerce.jpg"> $check_status['customers_name'] . ',' . "\n\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]);

 

I am getting an error. Can anybody please help?

 

Thanks!

Posted

can someone show me the code to get this to work in the emails that are sent to the store and customer after a purchase is made? I tried placed some test orders and it doesnt appear on that email--maybe I put it in the wrong place or file? any help is appreciated! Thanx

"I must admit that I personally measure success in terms of the contributions an individual makes to her or his fellow human beings."

---Margaret Mead---

 

"The answer is never the answer. What's really interesting is the mystery. If you seek the mystery instead of the answer, you'll always be seeking. I've never seen anybody really find the answer -- they think they have, so they stop thinking. But the job is to seek mystery, evoke mystery, plant a garden in which strange plants grow and mysteries bloom. The need for mystery is greater than the need for an answer.

--Ken Kesey"

Posted

double check the html is on when sending emails. osc admin->Configuration->E-Mail Options

Posted

yeah it is

but still not getting it to go thru with the logo--here is my line 43-55 from orders.php

$customer_notified = '0';
	  if (isset($HTTP_POST_VARS['notify']) && ($HTTP_POST_VARS['notify'] == 'on')) {
		$notify_comments = '';
		if (isset($HTTP_POST_VARS['notify_comments']) && ($HTTP_POST_VARS['notify_comments'] == 'on')) {
		  $notify_comments = sprintf(EMAIL_TEXT_COMMENTS_UPDATE, $comments) . "\n\n";
		}

		$email = '<img src="http://www.miysite.com/catalog/images/logo1.jpg">' . "\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]);

		tep_mail($email = '<img src="http://www.mysite.com/catalog/images/logo1.jpg">' . $check_status['customers_name'], $check_status['customers_email_address'], EMAIL_TEXT_SUBJECT, $email, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

		$customer_notified = '1';
	  }

 

any ideas what I am doing wrong? Thanks :thumbsup:

"I must admit that I personally measure success in terms of the contributions an individual makes to her or his fellow human beings."

---Margaret Mead---

 

"The answer is never the answer. What's really interesting is the mystery. If you seek the mystery instead of the answer, you'll always be seeking. I've never seen anybody really find the answer -- they think they have, so they stop thinking. But the job is to seek mystery, evoke mystery, plant a garden in which strange plants grow and mysteries bloom. The need for mystery is greater than the need for an answer.

--Ken Kesey"

Posted

you need to put it in the actual mail content not in the to correspondence.

 

so it should be:

 

$customer_notified = '0';
if (isset($HTTP_POST_VARS['notify']) && ($HTTP_POST_VARS['notify'] == 'on')) {
$notify_comments = '';
if (isset($HTTP_POST_VARS['notify_comments']) && ($HTTP_POST_VARS['notify_comments'] == 'on')) {
$notify_comments = sprintf(EMAIL_TEXT_COMMENTS_UPDATE, $comments) . "\n\n";
}

$email = '<img src="http://www.miysite.com/catalog/images/logo1.jpg">' . "\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]);

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

$customer_notified = '1';
}

 

cuz the $email variable includes the picture/html. Also from the orders will only work when you change the order's status. For the initial order it's the checkout_process.php that needs to be modified.

Posted

thanx--I will give it a go in a bit and post back--seems to make logical sense--although my brain does not always work logically! lol

Thanx enigma--much appreciation

"I must admit that I personally measure success in terms of the contributions an individual makes to her or his fellow human beings."

---Margaret Mead---

 

"The answer is never the answer. What's really interesting is the mystery. If you seek the mystery instead of the answer, you'll always be seeking. I've never seen anybody really find the answer -- they think they have, so they stop thinking. But the job is to seek mystery, evoke mystery, plant a garden in which strange plants grow and mysteries bloom. The need for mystery is greater than the need for an answer.

--Ken Kesey"

Posted

so if I want to add the image in the initial sent email after an order is placed I will do it in checkout_process.php

here is the code that I think I need to edit for that to happen but am unsure how to put it, any suggestions?

$customer_notification = (SEND_EMAILS == 'true') ? '1' : '0';
 $sql_data_array = array('orders_id' => $insert_id, 
					  'orders_status_id' => $order->info['order_status'], 
					  'date_added' => 'now()', 
					  'customer_notified' => $customer_notification,
					  'comments' => $order->info['comments']);
 tep_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array);

 

or maybe it will go in this code?

// 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 . "\n" .
				tep_address_label($customer_id, $sendto, 0, '', "\n") . "\n";
 }

 $email_order .= "\n" . EMAIL_TEXT_BILLING_ADDRESS . "\n" .
			  EMAIL_SEPARATOR . "\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, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

Thanks again for the help :)

"I must admit that I personally measure success in terms of the contributions an individual makes to her or his fellow human beings."

---Margaret Mead---

 

"The answer is never the answer. What's really interesting is the mystery. If you seek the mystery instead of the answer, you'll always be seeking. I've never seen anybody really find the answer -- they think they have, so they stop thinking. But the job is to seek mystery, evoke mystery, plant a garden in which strange plants grow and mysteries bloom. The need for mystery is greater than the need for an answer.

--Ken Kesey"

Posted

ok--figured it out--so everyone knows, this is how to add an image to the order email that the customer gets, go to checkout_process.php and around line 222 find this code:

// lets start with the email confirmation
$email_order = STORE_NAME . "\n" .

and under that add this with the correct link to your image or logo:

$email = '<img src="http://www.yoursite.com/catalog/images/logo1.jpg">' . "\n" .

and you can add a simple thank you text like this after that line:

$email_order .= "\r\nThank you for your order! " .

so it all together will look like this:

// lets start with the email confirmation
$email_order = STORE_NAME . "\n" .
$email = '<img src="http://www.yoursite.com/catalog/images/logo1.jpg">' . "\n" .
$email_order .= "\r\nThank you for your order! " .

 

Hope this helps someone!

"I must admit that I personally measure success in terms of the contributions an individual makes to her or his fellow human beings."

---Margaret Mead---

 

"The answer is never the answer. What's really interesting is the mystery. If you seek the mystery instead of the answer, you'll always be seeking. I've never seen anybody really find the answer -- they think they have, so they stop thinking. But the job is to seek mystery, evoke mystery, plant a garden in which strange plants grow and mysteries bloom. The need for mystery is greater than the need for an answer.

--Ken Kesey"

Archived

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

×
×
  • Create New...