Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] U HTML Emails


Recommended Posts

Hi, great work this contribution.

I installed and everything goes fine except the subject of "tell_a_friend" -> is empty!!

Here the code of my tell_a_friend.php:

 

 

//--- Beginning of addition: Ultimate HTML Emails ---//

if (EMAIL_USE_HTML == 'true') {

require(DIR_WS_MODULES . 'UHtmlEmails/'. ULTIMATE_HTML_EMAIL_LAYOUT .'/tell_a_friend.php');

$email_body = $html_email;

}else{//Send text email

//--- End of addition: Ultimate HTML Emails ---//

$email_subject = sprintf(TEXT_EMAIL_SUBJECT, $from_name, STORE_NAME);

$email_body = sprintf(TEXT_EMAIL_INTRO, $to_name, $from_name, $product_info['products_name'], STORE_NAME) . "\n\n";

 

if (tep_not_null($message)) {

$email_body .= $message . "\n\n";

}

 

$email_body .= sprintf(TEXT_EMAIL_LINK, tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_GET_VARS['products_id'], 'NONSSL', false)) . "\n\n" .

sprintf(TEXT_EMAIL_SIGNATURE, STORE_NAME . "\n" . HTTP_SERVER . DIR_WS_CATALOG . "\n");

//--- Beginning of addition: Ultimate HTML Emails ---//

}

 

if(ULTIMATE_HTML_EMAIL_DEVELOPMENT_MODE === 'true'){

//Save the contents of the generated html email to the harddrive in .htm file. This can be practical when developing a new layout.

$TheFileName = 'Last_mail_from_tell_a_friend.htm';

$TheFileHandle = fopen($TheFileName, 'w') or die("can't open error log file");

fwrite($TheFileHandle, $email_body);

fclose($TheFileHandle);

}

//--- End of addition: Ultimate HTML Emails ---//

tep_mail($to_name, $to_email_address, $email_subject, $email_body, $from_name, $from_email_address);

 

$messageStack->add_session('header', sprintf(TEXT_EMAIL_SUCCESSFUL_SENT, $product_info['products_name'], tep_output_string_protected($to_name)), 'success');

 

tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_GET_VARS['products_id']));

}

} elseif (tep_session_is_registered('customer_id')) {

$account_query = tep_db_query("select customers_firstname, customers_lastname, customers_email_address from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$customer_id . "'");

$account = tep_db_fetch_array($account_query);

 

$from_name = $account['customers_firstname'] . ' ' . $account['customers_lastname'];

$from_email_address = $account['customers_email_address'];

}

==========================

 

Thanks

Link to comment
Share on other sites

Hi there,

 

after I've installed U html (yes after making a backup first) I've added many other contributions only to find out at the end that U html wouldn't work out for me.

I've then executed an uninstall by putting original files back and crosschecking that no file had the "//--- Beginning of addition: Ultimate HTML Emails ---//" sections anymore.

 

This has worked out fine for U html: everything related to it is gone in the Admin and I can use the 'normal' newsletter functions. The Bulkmailer is however still active somehwere: although it's removed from the configuration table, the code is still looking for it which leads to the following error when sending a letter:

 

 

1064 - You have an error in your SQL syntax; 
check the manual that corresponds to your MySQL server version for the right syntax to use 
near 'BULKMAILER_LIMIT' at line 1

select customers_firstname, customers_lastname, customers_email_address 
from customers_temp limit BULKMAILER_LIMIT

[TEP STOP]

 

I do understand what the error means (a function is looking for the bulkmailer value in config table) but I can't seem to find which php file is still running the bulkmailer and therefore causing the issue.

 

Many thanks for some help on this please!

Link to comment
Share on other sites

Hi there,

 

after I've installed U html (yes after making a backup first) I've added many other contributions only to find out at the end that U html wouldn't work out for me.

I've then executed an uninstall by putting original files back and crosschecking that no file had the "//--- Beginning of addition: Ultimate HTML Emails ---//" sections anymore.

 

This has worked out fine for U html: everything related to it is gone in the Admin and I can use the 'normal' newsletter functions. The Bulkmailer is however still active somehwere: although it's removed from the configuration table, the code is still looking for it which leads to the following error when sending a letter:

 

 

1064 - You have an error in your SQL syntax; 
check the manual that corresponds to your MySQL server version for the right syntax to use 
near 'BULKMAILER_LIMIT' at line 1

select customers_firstname, customers_lastname, customers_email_address 
from customers_temp limit BULKMAILER_LIMIT

[TEP STOP]

 

I do understand what the error means (a function is looking for the bulkmailer value in config table) but I can't seem to find which php file is still running the bulkmailer and therefore causing the issue.

 

Many thanks for some help on this please!

 

Forget it, already figured it out!

Link to comment
Share on other sites

This is an html email contribution for osCommerce Online Merchant [2.2rc2]. It will replace the standard emails with emails that have more advanced layout and design. The contribution allows you to have different "html email layouts" installed at the same time. New layouts can easily be created and installed. You can easily change between the different "html email layouts" from a dropdown menu, "E-Mail Options"->"Html Email Layout", in the admin panel.

 

 

Hi,

I have been trying to implement both contributions U HTML (works fine, I love it) and the Edit Orders contribution, also a great contribution but for the email notifications.

The problem is that Edit Orders only creates text-emails and there are many places in the code where emails are created.

I would like that contribution to use Utml emails but I cannot get it to work.

Has anyone created an integration of the two?

I would like to see how you did that.

THX

Martina

(I also wrote this as a separate topic but this might be a better place)

Link to comment
Share on other sites

Hello, i have a problem. This is the way the mail is recived:

 

 

FANIT to me

show details 21:49 (3 minutes ago) Reply

 

 

--=_90cb4d49facc2d372f818986986d7931 Content-Type: text/plain; charset="iso-8859-2" Content-Transfer-Encoding: 7bit Dear xxx,Thank you for shopping with us today.Please find below the details of your order. Order Number: 9 Detailed Invoice: http://www.fanmegastore.ro/account_history_info.php?order_id=9 Date Ordered: 10 September, 2008 Contents of the order ProductModelPrice (Inc. VAT)Qty.Total (Inc. VAT) KINETIX LCDTV, 26", 700:1,500c, 8ms, WXGAKTLCDTV261,517.25RON11,517.25RONSub-Total: 1,517.25RONTVA: 242.25RONTotal: 1,517.25RONPayment Method: Plata la livrareDelivery AddressBilling AddressFlorin Stanagigelbucuresti, 021678B, RomaniaFlorin Stanagigelbucuresti, 021678B, Romania --=_90cb4d49facc2d372f818986986d7931 Content-Type: text/html; charset="iso-8859-2" Content-Transfer-Encoding: quoted-printable 
Dear Florin S= tana,
Thank you for shopping with us today.
Please find bel= ow the details of your order.

= = Order Number: 9
<= td><= strong>Detailed Invoice: http://www.fanmegastor= e.ro/account_history_info.php?order_id=3D9
= Date Ordered: 10 September, 2008= 

Contents of the order
Product= ModelPrice (Inc. VAT)= Qty.Total (Inc. VAT)
KINETIX LCDTV, 26", 700:1,500c, 8ms, WXGAKTLCDTV261= ,517.25RON11,517.25RON

Sub-To= tal: 1,517.25RON
TVA: 242.25RON= 
Total: 1,517.25RON

Payment Method: Plata la livrare

Delivery AddressBilling Address
xxxx
gigel
bucuresti, 021678
B, xxxxxx
gigel
bucuresti, 021678
B, Romania= 

--=_90cb4d49facc2d372f818986986d7931--

 

can you help me?

Link to comment
Share on other sites

Forget it, already figured it out!

 

Maybe you can help others, I get the error:

 

1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'EXISTS(SELECT * FROM uhtml_newsletters_sent WHERE customers_id=

 

SELECT c.customers_id, c.customers_firstname, c.customers_lastname, c.customers_email_address FROM customers c WHERE customers_newsletter = '1' AND NOT EXISTS(SELECT * FROM uhtml_newsletters_sent WHERE customers_id=c.customers_id AND newsletters_id='3') LIMIT 10

 

I have been up for three days, so I am not all together with it at this point. Any help would be appreciated.

Link to comment
Share on other sites

Hi Olov,

 

I've installed the contrib some days ago and meanwhile I just love it ;o)

But still I think there's something to do: You've added the gender greeting in version 2.1 - but only in create_account.

What I miss is a gender greeting for checkout_process and for admin notifications in orders.

I just checked if this was easy to be realized by myself - but it seems to be more difficult there.

Another point I'm thinking of is: Wouldn't it be more comfortable to let customers chose, whether they'd prefer HTML or plain text mails and save this setting in their personal settings ?

 

Thanks for your suggestions anyway,

 

Anton

Link to comment
Share on other sites

Hi Olof,

 

Awesome contribution! Many thanks!

 

A question: When sending customers automatic email (create_account, orders etc) everything works fine.

When sending newletters though is the html code sent in its pure form and the newsletter mail look like this:

 

<html><head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></head><body style="margin: 0px; padding: 0px; background-color:#edf6ff;"><font face="Times New Roman, Times, serif"><table width="100%" height="75px" border="0" background..............................border-color: #F96861;background-color:#FFFFFF;">Newsletter test text here.</div></font></body></html>

 

 

Any thoughts on why this happens?

 

Kind regards!

Link to comment
Share on other sites

Hi Olof,

 

Awesome contribution! Many thanks!

 

A question: When sending customers automatic email (create_account, orders etc) everything works fine.

When sending newletters though is the html code sent in its pure form and the newsletter mail look like this:

 

<html><head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></head><body style="margin: 0px; padding: 0px; background-color:#edf6ff;"><font face="Times New Roman, Times, serif"><table width="100%" height="75px" border="0" background..............................border-color: #F96861;background-color:#FFFFFF;">Newsletter test text here.</div></font></body></html>

 

 

Any thoughts on why this happens?

 

Kind regards!

 

If I read your question properly, you need to be of the understanding that the newsletter editor strips all html characters from what you typed so to speak, and leaves you with purely what you type, brackets included.

 

All HTML is generated prior to the editing of the contents. In other words, it will not send HTML form your editor, it sends it in HTML form, of which you edit through the newsletter.php script.

 

Is this close to answering you?

Link to comment
Share on other sites

Maybe you can help others, I get the error:

 

1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'EXISTS(SELECT * FROM uhtml_newsletters_sent WHERE customers_id=

 

SELECT c.customers_id, c.customers_firstname, c.customers_lastname, c.customers_email_address FROM customers c WHERE customers_newsletter = '1' AND NOT EXISTS(SELECT * FROM uhtml_newsletters_sent WHERE customers_id=c.customers_id AND newsletters_id='3') LIMIT 10

 

I have been up for three days, so I am not all together with it at this point. Any help would be appreciated.

 

 

Ok, after much toying around I finally decided that I should put something into the created database table for the mod. Everything works wonderfully now.

 

If you get this error, it probably means that the database table did not get any information inserted into it during the SQL installation.

 

All things come to those who wait. Or mess with stuff till they figure it out. Or break things and put them back together again. Or...

Link to comment
Share on other sites

Hiya,

 

Sorry to trouble you with what must be an easy addition for most, but with me being a complete dunce, I just can't quite work it out!

 

What I'd like is to add the customers email address & telephone at the bottom, next to the address details.

 

I've edited the forest green 'checkout_process.php file and managed to add another column with a title, but can't see how to insert the email & telephone details.

 

I've pasted the changes I've made below in the hope you could help me out???

 

Many thanks,

Keith

 

		$html_email .='<table style="font-size:14px; font-family:\'times\';" border="0" cellpadding="3" cellspacing="2" bgcolor=white>
		<tr style="background-color:#87A44C; color:#FFFFFF; font-weight:bold;">';
			if ($order->content_type != 'virtual') {
				$html_email .= '<td width="160"><font face="Times New Roman, Times, serif" style="font-size:14px;">'. UHE_TEXT_DELIVERY_ADDRESS .'</font></td>';
			}
			$html_email .= '<td width="160"><font face="Times New Roman, Times, serif" style="font-size:14px;">'. UHE_TEXT_BILLING_ADDRESS .'</font></td>';
			$html_email .= '<td width="160"><font face="Times New Roman, Times, serif" style="font-size:14px;">'. UHE_TEXT_EMAIL_TELEPHONE .'</font></td>
		</tr>
		<tr style="background-color:#DDDDDD;">';
			if ($order->content_type != 'virtual') {
				$html_email .= '<td><font face="Times New Roman, Times, serif" style="font-size:14px;">'. tep_address_label($customer_id, $sendto, 0, '', '<br />') .'</font></td>';
			}
			$html_email .= '<td><font face="Times New Roman, Times, serif" style="font-size:14px;">'. tep_address_label($customer_id, $billto, 0, '', '<br />') .'</font></td>';


			$html_email .= '<td><font face="Times New Roman, Times, serif" style="font-size:14px;">'. tep_address_label($customer_id, $email_subject, 0, '', '<br />') .'</font></td>';

			$html_email .= '<td><font face="Times New Roman, Times, serif" style="font-size:14px;">'. tep_address_label($customer_id, $telephone, 0, '', '<br />') .'</font></td>
		</tr>
	</table>
	';

In life, try everything three times...

First, just to see if you like it.

A Second, to see if you were mistaken the first,

And a third, to see if you tire of it quickly...

Link to comment
Share on other sites

Hiya,

 

Sorry to trouble you with what must be an easy addition for most, but with me being a complete dunce, I just can't quite work it out!

 

What I'd like is to add the customers email address & telephone at the bottom, next to the address details.

 

I've edited the forest green 'checkout_process.php file and managed to add another column with a title, but can't see how to insert the email & telephone details.

 

I've pasted the changes I've made below in the hope you could help me out???

 

Many thanks,

Keith

 

		$html_email .='<table style="font-size:14px; font-family:\'times\';" border="0" cellpadding="3" cellspacing="2" bgcolor=white>
		<tr style="background-color:#87A44C; color:#FFFFFF; font-weight:bold;">';
			if ($order->content_type != 'virtual') {
				$html_email .= '<td width="160"><font face="Times New Roman, Times, serif" style="font-size:14px;">'. UHE_TEXT_DELIVERY_ADDRESS .'</font></td>';
			}
			$html_email .= '<td width="160"><font face="Times New Roman, Times, serif" style="font-size:14px;">'. UHE_TEXT_BILLING_ADDRESS .'</font></td>';
			$html_email .= '<td width="160"><font face="Times New Roman, Times, serif" style="font-size:14px;">'. UHE_TEXT_EMAIL_TELEPHONE .'</font></td>
		</tr>
		<tr style="background-color:#DDDDDD;">';
			if ($order->content_type != 'virtual') {
				$html_email .= '<td><font face="Times New Roman, Times, serif" style="font-size:14px;">'. tep_address_label($customer_id, $sendto, 0, '', '<br />') .'</font></td>';
			}
			$html_email .= '<td><font face="Times New Roman, Times, serif" style="font-size:14px;">'. tep_address_label($customer_id, $billto, 0, '', '<br />') .'</font></td>';


			$html_email .= '<td><font face="Times New Roman, Times, serif" style="font-size:14px;">'. tep_address_label($customer_id, $email_subject, 0, '', '<br />') .'</font></td>';

			$html_email .= '<td><font face="Times New Roman, Times, serif" style="font-size:14px;">'. tep_address_label($customer_id, $telephone, 0, '', '<br />') .'</font></td>
		</tr>
	</table>
	';

Hi Keith,

I've added both Email and Phone number with this code:

<td>' .UHE_TEXT_EMAIL .'<br>' .$order->customer['email_address'] . '<br>' . UHE_TEXT_TELEPHONE .'<br>' .$order->customer['telephone']. '

and it works fine.

 

Anton

Link to comment
Share on other sites

If I read your question properly, you need to be of the understanding that the newsletter editor strips all html characters from what you typed so to speak, and leaves you with purely what you type, brackets included.

 

All HTML is generated prior to the editing of the contents. In other words, it will not send HTML form your editor, it sends it in HTML form, of which you edit through the newsletter.php script.

 

Is this close to answering you?

 

Many thanks for your answer hardball!

 

I'm not sure if I follow you all the way though. "..of which you edit through the newsletter.php script."

Do you talk about: mydomain.com/admin/newsletters.php?

I have tried non html code as well as html code here. Both mails come out as plain code... :blink: :blink:

 

In simple words: How and where do I edit my newsletter code?

Link to comment
Share on other sites

Hiya Anton,

 

Many thanks for your reply.

Used your bit of code and it's perfect - just what I wanted!

 

Kind Regards

Keith

In life, try everything three times...

First, just to see if you like it.

A Second, to see if you were mistaken the first,

And a third, to see if you tire of it quickly...

Link to comment
Share on other sites

Just when I thought all was well...

 

Seems I have the same problem as others in this thread where I get plain text emails when paying by PayPal.

I'm using the version of PayPal Standard as supplied with osCommerce RC2a

Tried the fix posted earlier in this thread:

 

//---  Beginning of addition: Ultimate HTML Emails  ---//
if (EMAIL_USE_HTML == 'true') {	require(DIR_WS_MODULES . 'UHtmlEmails/checkout_process_'. ULTIMATE_HTML_EMAIL_LAYOUT .'.php');	$email_order = $html_email;}else  //Send text email
//---  End of addition: Ultimate HTML Emails  ---//

 

but get errors when returning from Paypal:

 

Warning: paypal_standard::require(includes/modules/UHtmlEmails/checkout_process_Forest Green.php) [function.paypal-standard-require]: failed to open stream: No such file or directory in /home/xxxx/xxxx/includes/modules/payment/paypal_standard.php on line 504

 

Warning: paypal_standard::require(includes/modules/UHtmlEmails/checkout_process_Forest Green.php) [function.paypal-standard-require]: failed to open stream: No such file or directory in /home/xxxx/xxxx/includes/modules/payment/paypal_standard.php on line 504

 

Fatal error: paypal_standard::require() [function.require]: Failed opening required 'includes/modules/UHtmlEmails/checkout_process_Forest Green.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/xxxx/xxxx/includes/modules/payment/paypal_standard.php on line 504

 

The HTML emails look so good I'd really like to use them so i was wondering if anybody has got this working with the PayPal Standard module included with RC2a? If anyone has, please could you let me know how it's done? (be gentle, I'm a coding dummy!)

Many Thanks

Keith

In life, try everything three times...

First, just to see if you like it.

A Second, to see if you were mistaken the first,

And a third, to see if you tire of it quickly...

Link to comment
Share on other sites

Hey Keith,

 

Could you post the code from -

/home/xxxx/xxxx/includes/modules/payment/paypal_standard.php on line 504

A few lines before and after might help.

 

I'm not using RC2a but might be able to figure something out once I see the code.

- :: Jim :: -

- My Toolbox ~ Adobe Web Bundle, XAMPP & WinMerge | Install ~ osC v2.3.3.4 -

Link to comment
Share on other sites

Hiya Jim,

 

Thanks for getting back to me.

 

What I did was to copy the code from earlier in this thread (on pg2)...

 

// EOF content type fix by AlexStudio// $order variables have been changed from checkout_process to work with the variables from the function query () instead of cart () in the order class//---  Beginning of addition: Ultimate HTML Emails  ---//if (EMAIL_USE_HTML == 'true') {	require(DIR_WS_MODULES . 'UHtmlEmails/checkout_process_'. ULTIMATE_HTML_EMAIL_LAYOUT .'.php');	$email_order = $html_email;}else{//Send text email//---  End of addition: Ultimate HTML Emails  ---//		  $order = new order($insert_id);

 

... and inserted it where I think the email generation starts in paypal_standard.php (from RC2a)...

 

//------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;

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

// lets start with the email confirmation
  $email_order = STORE_NAME . "\n" .
				 EMAIL_SEPARATOR . "\n" .
				 EMAIL_TEXT_ORDER_NUMBER . ' ' . $order_id . "\n" .
				 EMAIL_TEXT_INVOICE_URL . ' ' . tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $order_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);

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

// load the after_process function from the payment modules
  $this->after_process();

  $cart->reset(true);

// unregister session variables used during checkout
  tep_session_unregister('sendto');
  tep_session_unregister('billto');
  tep_session_unregister('shipping');
  tep_session_unregister('payment');
  tep_session_unregister('comments');

 

So from line 501

// lets start with the email confirmation

to line 539

tep_mail($order->customer['firstname'] . ' ' . $order->customer['lastname'], $order->customer['email_address'], EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

 

was deleted and replaced with the "Beginning of addition: Ultimate HTML Emails" code at the top. I assumed this would redirect the email generation to Ultimate HTML, but no email was sent and the errors appeared when returning from paypal.

 

I'm not able to write any of my own code or anything more than very basic html, but have a logical approach and am good at copying & pasting other experts code! (and yes - I backup before I do anything!)

 

So, any help & pointers you can give me would be greatly appreciated

 

Kind Regards

Keith

In life, try everything three times...

First, just to see if you like it.

A Second, to see if you were mistaken the first,

And a third, to see if you tire of it quickly...

Link to comment
Share on other sites

Hiya Jim,

 

Thanks for getting back to me.

 

What I did was to copy the code from earlier in this thread (on pg2)...

 

// EOF content type fix by AlexStudio// $order variables have been changed from checkout_process to work with the variables from the function query () instead of cart () in the order class//---  Beginning of addition: Ultimate HTML Emails  ---//if (EMAIL_USE_HTML == 'true') {	require(DIR_WS_MODULES . 'UHtmlEmails/checkout_process_'. ULTIMATE_HTML_EMAIL_LAYOUT .'.php');	$email_order = $html_email;}else{//Send text email//---  End of addition: Ultimate HTML Emails  ---//		  $order = new order($insert_id);

 

... and inserted it where I think the email generation starts in paypal_standard.php (from RC2a)...

 

Hey Keith, first a word of warning - I don't really know PHP, I just trial & error hack until I either fix it or give up. <_<

 

First off, there is an error in your pasted code above. It should look like this -

 

//--- Beginning of addition: Ultimate HTML Emails ---//

if (EMAIL_USE_HTML == 'true') {

require(DIR_WS_MODULES . 'UHtmlEmails/'. ULTIMATE_HTML_EMAIL_LAYOUT .'/checkout_process.php');

$email_order = $html_email;

}else{//Send text email

//--- End of addition: Ultimate HTML Emails ---//

 

I read through the post on page two, I get the impression that would fix the emails being sent to the store owner and not the customer. But I could be wrong! I haven't gotten to the point of testing my site yet by completing a purchase through PayPal myself to see if I have a similar problem.

 

I just looked through my paypal.php and paypal_ipn.php files and found nothing calling for sending emails.

Did the email functions work properly prior to installing UHTML Emails?

Have you tried setting up your PayPal account to return customers to your site after completion? I wonder if that would activate an email???

 

// lets start with the email confirmation
  $email_order = STORE_NAME . "\n" .
				 EMAIL_SEPARATOR . "\n" .
				 EMAIL_TEXT_ORDER_NUMBER . ' ' . $order_id . "\n" .
				 EMAIL_TEXT_INVOICE_URL . ' ' . tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $order_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);

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

// load the after_process function from the payment modules
  $this->after_process();

  $cart->reset(true);

 

I wonder what would happen if one of these changes were made? -

 

// load the after_process function from the payment modules

$this->after_process();

$email_order = $html_email;

$cart->reset(true);

 

or not deleting anything and try adding -

 

//--- Beginning of addition: Ultimate HTML Emails ---//

if (EMAIL_USE_HTML == 'true') {

require(DIR_WS_MODULES . 'UHtmlEmails/'. ULTIMATE_HTML_EMAIL_LAYOUT .'/checkout_process.php');

$email_order = $html_email;

}else{//Send text email

//--- End of addition: Ultimate HTML Emails ---//

 

After -

// lets start with the email confirmation

 

Or before -

// load the after_process function from the payment modules

 

Just some thoughts. :huh:

- :: Jim :: -

- My Toolbox ~ Adobe Web Bundle, XAMPP & WinMerge | Install ~ osC v2.3.3.4 -

Link to comment
Share on other sites

Hey Keith, first a word of warning - I don't really know PHP, I just trial & error hack until I either fix it or give up. <_<

 

First off, there is an error in your pasted code above. It should look like this -

 

//--- Beginning of addition: Ultimate HTML Emails ---//

if (EMAIL_USE_HTML == 'true') {

require(DIR_WS_MODULES . 'UHtmlEmails/'. ULTIMATE_HTML_EMAIL_LAYOUT .'/checkout_process.php');

$email_order = $html_email;

}else{//Send text email

//--- End of addition: Ultimate HTML Emails ---//

 

I read through the post on page two, I get the impression that would fix the emails being sent to the store owner and not the customer. But I could be wrong! I haven't gotten to the point of testing my site yet by completing a purchase through PayPal myself to see if I have a similar problem.

 

I just looked through my paypal.php and paypal_ipn.php files and found nothing calling for sending emails.

Did the email functions work properly prior to installing UHTML Emails?

Have you tried setting up your PayPal account to return customers to your site after completion? I wonder if that would activate an email???

 

 

 

I wonder what would happen if one of these changes were made? -

 

// load the after_process function from the payment modules

$this->after_process();

$email_order = $html_email;

$cart->reset(true);

 

or not deleting anything and try adding -

 

//--- Beginning of addition: Ultimate HTML Emails ---//

if (EMAIL_USE_HTML == 'true') {

require(DIR_WS_MODULES . 'UHtmlEmails/'. ULTIMATE_HTML_EMAIL_LAYOUT .'/checkout_process.php');

$email_order = $html_email;

}else{//Send text email

//--- End of addition: Ultimate HTML Emails ---//

 

After -

// lets start with the email confirmation

 

Or before -

// load the after_process function from the payment modules

 

Just some thoughts. :huh:

 

Hiya Jim,

 

Many thanks for "your thoughts" - they're very much appreciated.

I always backup everything before I make any changes - I'm sure my php knowledge is far less than yours!

With the paypal_standard.php file in it's original form, the customer receives an order confirmation email & I get a copy, but in plain text (very boring!)

 

I'll go play with your ideas and let you know what happens

 

Kind Regards

Keith

In life, try everything three times...

First, just to see if you like it.

A Second, to see if you were mistaken the first,

And a third, to see if you tire of it quickly...

Link to comment
Share on other sites

With the paypal_standard.php file in it's original form, the customer receives an order confirmation email & I get a copy, but in plain text (very boring!)

 

Hey Keith,

 

Before the addition of U HTML did "any" of your shops emails send as HTML or were they all text?

- :: Jim :: -

- My Toolbox ~ Adobe Web Bundle, XAMPP & WinMerge | Install ~ osC v2.3.3.4 -

Link to comment
Share on other sites

Can anyone tell me how to add this contribution to order_editor_5_0_63? When I update order status to processing or shipped, it notifies the customer but it is in plain text. It does have an html link that works>> Detailed Invoice: order_id=5746

I'm not even sure which file I should be trying to edit.

 

Dear Test Account,

Ricks PC Parts
------------------------------------------------------
Order Number: 5746
Detailed Invoice: order_id=5746
Date Ordered: Saturday 11 October, 2008
------------------------------------------------------


Your order has been updated to the following status: Shipped

If necessary, you may update your order directly by following the link above (login required). If you have questions or comments, please reply to this email.

With warm regards from your friends at Ricks PC Parts

Link to comment
Share on other sites

Is it possible instead of store name in de email to put your logo in it?

Does anyone know that?

If it's possible where do i put that i tried a couple of thing but it didn't work! :blink:

 

 

Hi Nick

I use a logo image with this:

In catalog/includes/languages/modules/UHtmlEmails/Standard/"all files you want" :

 

define('UHE_GREET_MR', '<a href="http://www.YOURSITE.com"><img src=http://www.YOURSITE.com/images/logo.gif width=240 height=92 border=0></a><br /> Exmo(a). Sr(a). %s,');

define('UHE_GREET_MS', '<a href="http://www.YOURSITE.com"><img src=http://www.YOURSITE.com/images/logo.gif width=240 height=92 border=0></a><br /> Exmo(a). Sr(a). %s,');

define('UHE_GREET_NONE', '<a href="http://www.YOURSITE.com"><img src=http://www.YOURSITE.com/images/logo.gif width=240 height=92 border=0></a><br /> Exmo(a). Sr(a). %s,');

 

Don't forget customize url's and width and height image settings

:)

Adelino

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