Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[contribution] Send_order_html_email


Elazar

Recommended Posts

Hi Guys,

 

I've noticed that the emails do not display correctly when they are sent to a web based email address (hotmail, msn, yahoo, lycos ...)

The background colours and everything do not come out as they do with pop3 email address. The picture will show what i mean, Is anyone else having this problem ? Please Help.

 

problem2.jpg

 

Shingi

www.clemstone.co.za

South Africa

It does work, you may have to change some values to get it to be around 800pixels.

 

If your website is on your pc, you will never see images in hotmail.

Edited by Coopco
Link to comment
Share on other sites

  • Replies 344
  • Created
  • Last Reply

Top Posters In This Topic

It does work, you may have to change some values to get it to be around 800pixels.

 

If your website is on your pc, you will never see images in hotmail.

 

Hi Frank,

 

My website is not on my PC. It has been uploaded to htp://www.clemstone.co.za

 

I don't understand what you say I must do, please help.

 

Shingi

www.clemstone.co.za

South Africa

Link to comment
Share on other sites

Hi Frank,

 

My website is not on my PC. It has been uploaded to htp://www.clemstone.co.za

 

I don't understand what you say I must do, please help.

 

Shingi

www.clemstone.co.za

South Africa

OK, forget that. It is not picking up the stylesheet. What browser are you using?

Link to comment
Share on other sites

I get the same problem with Internet Explorer 7

Had a quick look at the orders you sent to me at my hotmail account. I use outlook express to read my hotmail, and the orders from your look like you said for POP3. When I use the browser to look at the hotmail email, the orders from your shop look like you said for hotmail.

 

When I do the same for orders from my shop, the same thing happens.

 

The conclusion is that hotmail is ignoring some of the formatting. I do not know of a fix for this.

Link to comment
Share on other sites

Hi,

 

I use send html email row mod and it works very good. Thanks to the author.

 

When I installed activation code contrib. there is a little conflict. It sends 2 emails when customers create an account...

 

Did someone installed this 2 contrib. together and can help me to solve it please??

 

Here is the section in my create_account.php that the code is there:

 

if (ACTIVATION_CODE == 'off') {

// $email_text .= EMAIL_WELCOME . EMAIL_TEXT . EMAIL_CONTACT . EMAIL_WARNING;

tep_mail($name, $email_address, EMAIL_SUBJECT, $email_text, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

tep_redirect(tep_href_link(FILENAME_CREATE_ACCOUNT_SUCCESS, '', 'SSL'));

} else {

$activation_id = md5($email_address);

$verification_href = tep_href_link(FILENAME_ACCOUNT_ACTIVATE, 'activation_id=' . $activation_id, 'SSL');

$verification_mail = tep_href_link(FILENAME_ACCOUNT_ACTIVATE, 'activation_id=' . $activation_id . '&activation_code=' . $activation_code, 'SSL');

$verification_link = '<a href="' . $verification_mail . '">' . $verification_mail . '</a>' ."\n\n";

$activation_text = EMAIL_TEXT_ACTIVATION;

$email_text .= EMAIL_WELCOME . EMAIL_TEXT . $activation_text . $verification_link . EMAIL_CONTACT . EMAIL_WARNING;

tep_mail($name, $email_address, EMAIL_SUBJECT, $email_text, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

tep_redirect($verification_href);

 

I think I should change the line:

 

$email_text .= EMAIL_WELCOME . EMAIL_TEXT . $activation_text . $verification_link . EMAIL_CONTACT . EMAIL_WARNING;

 

TO something like that:

 

$email_text .= $activation_text . $verification_link . EMAIL_CONTACT . EMAIL_WARNING;

 

Please correct me if this is the right solution...

 

Thanks for the kind attention !!

Best Regards,

Nathali

Link to comment
Share on other sites

Hi,

 

I use send html email row mod and it works very good. Thanks to the author.

 

When I installed activation code contrib. there is a little conflict. It sends 2 emails when customers create an account...

 

Did someone installed this 2 contrib. together and can help me to solve it please??

 

Here is the section in my create_account.php that the code is there:

 

if (ACTIVATION_CODE == 'off') {

// $email_text .= EMAIL_WELCOME . EMAIL_TEXT . EMAIL_CONTACT . EMAIL_WARNING;

tep_mail($name, $email_address, EMAIL_SUBJECT, $email_text, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

tep_redirect(tep_href_link(FILENAME_CREATE_ACCOUNT_SUCCESS, '', 'SSL'));

} else {

$activation_id = md5($email_address);

$verification_href = tep_href_link(FILENAME_ACCOUNT_ACTIVATE, 'activation_id=' . $activation_id, 'SSL');

$verification_mail = tep_href_link(FILENAME_ACCOUNT_ACTIVATE, 'activation_id=' . $activation_id . '&activation_code=' . $activation_code, 'SSL');

$verification_link = '<a href="' . $verification_mail . '">' . $verification_mail . '</a>' ."\n\n";

$activation_text = EMAIL_TEXT_ACTIVATION;

$email_text .= EMAIL_WELCOME . EMAIL_TEXT . $activation_text . $verification_link . EMAIL_CONTACT . EMAIL_WARNING;

tep_mail($name, $email_address, EMAIL_SUBJECT, $email_text, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

tep_redirect($verification_href);

 

I think I should change the line:

 

$email_text .= EMAIL_WELCOME . EMAIL_TEXT . $activation_text . $verification_link . EMAIL_CONTACT . EMAIL_WARNING;

 

TO something like that:

 

$email_text .= $activation_text . $verification_link . EMAIL_CONTACT . EMAIL_WARNING;

 

Please correct me if this is the right solution...

 

Thanks for the kind attention !!

 

any help please ??

Best Regards,

Nathali

Link to comment
Share on other sites

  • 1 month later...
Hi Guys,

 

I installed the contribution and everything is working well just that the billing address does not show. The pictures shows what i get. Please help.

 

problem.jpg

 

Shingi

www.clemstone.co.za

South Africa

 

How do you get these colors?

 

My layout is all white. Only dark grey at the logo, and very light grey till the product layout (Image/Model/qty/total.

The rest white!

Link to comment
Share on other sites

I think I was getting this and I think I changed

admin/includes/orders.php

to

define('EMAIL_TEXT_COMMENTS_UPDATE', 'Our comments for your order are:' . "\n");

 

Well this not working for me. The %s dissapears but also the status change was gone.

And the comments I make, never showed up.

 

is there some other solution?

Link to comment
Share on other sites

Here a change in the checkout.php.

 

I got a wrong internetlink to page in the order mail.

 

change this to:

$Varlogo = ''.VARLOGO.'' ;
$Vartable1 = ''.VARTABLE1.'' ;
$Vartable2 = ''.VARTABLE2.'' ;

$Vartext1 = ' <b>' . EMAIL_TEXT_DEAR . ' ' . $order->customer['firstname'] . ' ' . $order->customer['lastname'] .' </b><br>'. EMAIL_MESSAGE_GREETING ;
$Vartext2 = '    ' . EMAIL_TEXT_ORDER_NUMBER . ' <STRONG> ' . 
$insert_id . '</STRONG><br>' . EMAIL_TEXT_DATE_ORDERED . '<strong>' . strftime[u](DATE_FORMAT_LONG) . '</strong><br><br><a href="' . tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $insert_id, 'SSL', false) .'">' . EMAIL_TEXT_INVOICE_URL . '</a>' ; [/u]

$Varmailfooter = ''.VARMAILFOOTER.'' ;
$VarArticles= ''.EMAIL_TEXT_PRODUCTS_ARTICLES.'' ;

Link to comment
Share on other sites

$Vartext2 = ' ' . EMAIL_TEXT_ORDER_NUMBER . ' <STRONG> ' . $insert_id . '</STRONG><br>' . EMAIL_TEXT_DATE_ORDERED . ': <strong>' . strftime(DATE_FORMAT_LONG) . '</strong><br><a href="' . HTTP_SERVER . DIR_WS_CATALOG . 'account_history_info.php?order_id=' . $insert_id .'">' . EMAIL_TEXT_INVOICE_URL . '</a>' ;

Link to comment
Share on other sites

Well this not working for me. The %s dissapears but also the status change was gone.

And the comments I make, never showed up.

 

is there some other solution?

 

 

Ok here my solution

 

In the languagefile there was an error:

 

define('EMAIL_TEXT_COMMENTS_UPDATE', 'Eventuele opmerking(en) bij uw bestelling:' . "\n\n%s\n\n");

 

changed into this

 

define('EMAIL_TEXT_COMMENTS_UPDATE', 'Eventuele opmerking(en) bij uw bestelling:' . "\n\n\n\n");
Link to comment
Share on other sites

If you got some error with the orderlink in the customermail, after updating your order or change the status in the background.

 

Change this in your order.php

 

 

$Vartext2 = ' ' . EMAIL_TEXT_ORDER_NUMBER . ' <STRONG> ' . $oID . '</STRONG><br>' . EMAIL_TEXT_DATE_ORDERED . '<strong>' . strftime(DATE_FORMAT_LONG) . '</strong><br><a href="' . HTTP_SERVER . DIR_WS_CATALOG . 'account_history_info.php?order_id=' . $insert_id .'">' . EMAIL_TEXT_INVOICE_URL . '</a>' ;

 

into

 

$Vartext2 = ' ' . EMAIL_TEXT_ORDER_NUMBER . ' <STRONG> ' . $oID . '</STRONG><br>' . EMAIL_TEXT_DATE_ORDERED . '<strong>' . strftime(DATE_FORMAT_LONG) . '</strong><br><a href="' . tep_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, 'order_id='. $oID, 'SSL', false).'">' . EMAIL_TEXT_INVOICE_URL . '</a>' ;
Edited by Simpel
Link to comment
Share on other sites

  • 3 weeks later...

Hello, I'm using this contrib and it's working great for me but I'm having a problem with implementing the code into the idealm contrib. This contrib does send the email from a different location admin/idealm_email.php. I've tried to paste the code from checkout process but that didn't work correctly. The mail is sended but there is no VAT applied and order total isn't working either.

 

Could someone please help me out here? It's a working store and the customers are getting confused right now.

 

This is the code i'm currently using in idealm_email.php:

 

<?php
/*
 $Id: idealm_email.php,v 1.2 2007/02/17 22:50:52 jb Exp $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com


 Released under the GNU General Public License

*/

 $products_ordered = '';
 $subtotal = 0;
 $total_tax = 0;

 for ($i=0, $n=sizeof($order->products); $i<$n; $i++) {
// Stock Update - Joao Correia
if (STOCK_LIMITED == 'true') {
  if (DOWNLOAD_ENABLED == 'true') {
	$stock_query_raw = "SELECT products_quantity, pad.products_attributes_filename 
						FROM " . TABLE_PRODUCTS . " p
						LEFT JOIN " . TABLE_PRODUCTS_ATTRIBUTES . " pa
						 ON p.products_id=pa.products_id
						LEFT JOIN " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad
						 ON pa.products_attributes_id=pad.products_attributes_id
						WHERE p.products_id = '" . tep_get_prid($order->products[$i]['id']) . "'";
// Will work with only one option for downloadable products
// otherwise, we have to build the query dynamically with a loop
	$products_attributes = $order->products[$i]['attributes'];
	if (is_array($products_attributes)) {
	  $stock_query_raw .= " AND pa.options_id = '" . $products_attributes[0]['option_id'] . "' AND pa.options_values_id = '" . $products_attributes[0]['value_id'] . "'";
	}
	$stock_query = tep_db_query($stock_query_raw);
  } else {
	$stock_query = tep_db_query("select products_quantity from " . TABLE_PRODUCTS . " where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'");
  }
  if (tep_db_num_rows($stock_query) > 0) {
	$stock_values = tep_db_fetch_array($stock_query);
  }
}
//------insert customer choosen option to order--------
//hier is een groot deel code opgeruimd, laatste regel aangepast (17-2-2007)
$products_ordered_attributes = '';
  if ( (isset($order->products[$i]['attributes'])) && (sizeof($order->products[$i]['attributes']) > 0) ) {
		for ($j=0, $n2=sizeof($order->products[$i]['attributes']); $j<$n2; $j++) {
		   $products_ordered_attributes .= "\n\t" . $order->products[$i]['attributes'][$j]['option'] . ' ' . $order->products[$i]['attributes'][$j]['value'];
		 }
  }

//------insert customer choosen option eof ----
$total_weight += ($order->products[$i]['qty'] * $order->products[$i]['weight']);
$total_tax += tep_calculate_tax($total_products_price, $products_tax) * $order->products[$i]['qty'];
$total_cost += $total_products_price;

//BEGIN SEND HTML MAIL//

$products_ordered .= $order->products[$i]['qty'] . ' x ' . $order->products[$i]['name'] . ' (' . $order->products[$i]['model'] . ') = ' . $currencies->display_price($order->products[$i]['final_price'], $order->products[$i]['tax'], $order->products[$i]['qty']) . $products_ordered_attributes . "\n";
$products_quantity .= nl2br($order->products[$i]['qty'] . "\n");
$products_name .= nl2br("" . $order->products[$i]['name'] . $products_ordered_attributes ."\n");

if (!tep_not_null($order->products[$i]['model'])) {
   $products_model .= ''.EMAIL_NO_MODEL.'';
	 }
else
   $products_model .= nl2br($order->products[$i]['model'] . "\n");


$products_price .= nl2br($currencies->format($order->products[$i]['final_price'] * $order->products[$i]['qty']) . "\n");

}




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


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

if (is_object($$payment)) {
$Varmodepay .= EMAIL_TEXT_PAYMENT_METHOD . "\n" . 
				EMAIL_SEPARATOR . "\n";
$payment_class = $$payment;
$Varmodpay .= $payment_class->title . "\n";
if ($payment_class->email_footer) { 
  $Varmodpay .= $payment_class->email_footer . "\n\n";
}
 }

$Varlogo = ''.VARLOGO.'';
$Vartable1 = ''.VARTABLE1.'';
$Vartable2 = ''.VARTABLE2.'';

$Vartext1 = ' <b>' . EMAIL_TEXT_DEAR . ' ' . $order->customer['firstname'] . ' ' . $order->customer['lastname'] .' </b><br>' . EMAIL_MESSAGE_GREETING;
$Vartext2 = '	' . EMAIL_TEXT_ORDER_NUMBER . ' <STRONG> ' . $insert_id . '</STRONG><br>' . EMAIL_TEXT_DATE_ORDERED . '<strong>' . strftime(DATE_FORMAT_LONG) . '</strong><br><a href="' . HTTP_SERVER . DIR_WS_CATALOG . 'account_history_info.php?order_id=' . $insert_id .'">' . EMAIL_TEXT_INVOICE_URL . '</a>'; 

$Varmailfooter = ''.VARMAILFOOTER.'';
$VarArticles= ''.EMAIL_TEXT_PRODUCTS_ARTICLES.'';
$VarQte= ''.EMAIL_TEXT_PRODUCTS_QTY .'';
$VarTotal= ''.EMAIL_TEXT_TOTAL.'';
$VarAddresship = ''.EMAIL_TEXT_DELIVERY_ADDRESS.'';
$Varmetodpaye = ''.EMAIL_TEXT_PAYMENT_METHOD.'';
$Vardetail = ''.DETAIL .'';
$Varhttp = ''.VARHTTP.'';
$Varstyle = ''.VARSTYLE.'';
$Varshipaddress =''.tep_address_label($customer_id, $sendto).'';



require(DIR_WS_MODULES . 'email/html_checkout_process.php');
$email_order = $html_email_order;

// lets start with the email confirmation
if (EMAIL_USE_HTML == 'true') {

$email_order;

} 
else

{

$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; $i<sizeof($order_totals); $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\n\n\n";
if ($payment_class->email_footer) { 
  $email_order .= $payment_class->email_footer . "\n\n";
}
 }

 $email_order .= "\n" . EMAIL_TEXT_FOOTER . "\n" .
					HTTP_SERVER . DIR_WS_CATALOG . "\n" . 
					EMAIL_TEXT_FOOTERR . "\n";

}


 tep_mail($order->customer['firstname'] . ' ' . $order->customer['lastname'], $order->customer['email_address'], EMAIL_TEXT_SUBJECT, nl2br($email_order), STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, '');
 $email_order=ereg_replace("[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]","<a href=\"\\">\</a>", $email_order);

// send emails to other people
 if (SEND_EXTRA_ORDER_EMAILS_TO != '') {
$email_order = $html_email_order;
if (EMAIL_USE_HTML == 'true') {

$email_order;

} 
else

{

$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; $i<sizeof($order_totals); $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\n\n\n";
if ($payment_class->email_footer) { 
  $email_order .= $payment_class->email_footer . "\n\n";
}
 }

 $email_order .= "\n" . EMAIL_TEXT_FOOTER . "\n" .
					HTTP_SERVER . DIR_WS_CATALOG . "\n" . 
					EMAIL_TEXT_FOOTERR . "\n";

}
tep_mail('', SEND_EXTRA_ORDER_EMAILS_TO, EMAIL_TEXT_SUBJECT, nl2br($email_order), STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, '');
$email_order=ereg_replace("[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]","<a href=\"\\">\</a>", $email_order);
 } 

//END SEND HTML MAIL//

?>

 

Thanx in advance

Link to comment
Share on other sites

Hello, I'm using this contrib and it's working great for me but I'm having a problem with implementing the code into the idealm contrib. This contrib does send the email from a different location admin/idealm_email.php. I've tried to paste the code from checkout process but that didn't work correctly. The mail is sended but there is no VAT applied and order total isn't working either.

 

Could someone please help me out here? It's a working store and the customers are getting confused right now.

 

This is the code i'm currently using in idealm_email.php:

 

So sorry, didn't read the rowmod file propperly so the problem with VAT is solved.

 

The problem with order total (only showing the shipping amount) when payed with iDeal is still present. Help would be appreciated

 

Thanx again

Link to comment
Share on other sites

unfortunately not for me. I changed it directly into the html file and works ok for now

 

I am having this same problem it's all white how do I add some color?

Site is underconstruction I am always looking for good advice on how to improve my site fill free to comment.

Thanks! ATise

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