Jump to content



Photo
* * * - - 2 votes

[Contribution] U HTML Emails


  • Please log in to reply
244 replies to this topic

#1   Olof Larsson

Olof Larsson
  • Members
  • 91 posts
  • Real Name:Olof Larsson
  • Gender:Male
  • Location:Sweden

Posted 18 March 2008 - 16:14

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.

#2   Arodiszlec

Arodiszlec
  • Members
  • 3 posts
  • Real Name:Tályai Gábor
  • Gender:Male
  • Location:Hungary

Posted 18 March 2008 - 16:41

first bug /smile.gif' class='bbc_emoticon' alt=':)' />

empty zip file, for me...

#3   jan64

jan64
  • Members
  • 133 posts
  • Real Name:Jan Swart
  • Gender:Male
  • Location:Holland

Posted 18 March 2008 - 19:15

Hi,

this is exactly the contri where i was looking for.

Question, the order update's are they also in a new layout?

kind regards,
Jan
Dreams can come true, if you help them a littlebit

#4   kbking

kbking
  • Members
  • 266 posts
  • Real Name:Chris

Posted 18 March 2008 - 21:08

Hej, Olof!

Det är användbara och kreativa tillägg du komponerar. Min eloge! Now better stick to the English language for the benefit of other community members.

Would this fit into a v. 2.2 patched with RC1 and RC2?

How likely is it that other contributions installed will interfere?

Are there any other prerequisites that has to be met?

Regards!

#5   WebSource 5

WebSource 5

    ıllıllı < /> ıllıllı

  • Community Sponsor
  • 777 posts
  • Real Name:G.L.Walker
  • Gender:Male
  • Location:Republic of Texas

Posted 18 March 2008 - 22:41

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.

I just looked at this and Its a very nice addon. It really will add a professional touch to any store. I like that it doesnt have to create any extra database table like some other one does.
Thanks for giving us this.

Follow the community build:

BS3 to osCommerce Responsive from the Get Go!

Check out the new construction:

Admin Gone to Total BS!


#6   Java Roasters

Java Roasters
  • Members
  • 2,146 posts
  • Real Name:Peter
  • Gender:Male
  • Location:Ontario, Canada

Posted 19 March 2008 - 05:56

I just installed it with NO problems on 2.2ms2-060817. It is a VERY easy install and works great. The only thing I have seen is that on the create account email the subject was "EMAIL_SUBJECT" instead of "Welcome to STORE NAME". I am sure that is a 2 minute fix.

The emails look great out of the box but I only tested in Thunderbird.

This is an excellent piece of work. /thumbsup.gif' class='bbc_emoticon' alt=':thumbsup:' />

#7   jan64

jan64
  • Members
  • 133 posts
  • Real Name:Jan Swart
  • Gender:Male
  • Location:Holland

Posted 19 March 2008 - 06:12

Hi,

this is exactly the contri where i was looking for.

Question, the order update's are they also in a new layout?

kind regards,
Jan


I have puzzled the hole night, and it looks really nice.
Forget the question above.
I have so much conti's build in that i have a lot of work before it works correctly, but i have seen that the order update is present.

regards,
jan
Dreams can come true, if you help them a littlebit

#8   mark27uk3

mark27uk3
  • Members
  • 1,547 posts
  • Real Name:Mark
  • Gender:Male
  • Location:24-7 Mobile Accessories

Posted 20 March 2008 - 16:14

Hi All,

I added this contribution last night and it works like a bloomin charm. However I do have one strange issue.

Our checkout process is highly modified and it sends a system generated password to the customer in the welcome email. The issue is that all information is present in the welcome email apart from the customers login and password details.

I am presuming that they are being stripped out somewhere along the line.

This is the code from our checkout page.
// build the message content

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

	  $email_text = sprintf(EMAIL_GREET_NONE, $firstname . ' ' . $lastname) . EMAIL_TEXT0 . sprintf(EMAIL_LOGIN, $email_address) . sprintf(EMAIL_PASSWORD, $new_password) . EMAIL_TEXT1 . EMAIL_WARNING;

//---  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_create_account.php.htm';
	$TheFileHandle = fopen($TheFileName, 'w') or die("can't open error log file");
	fwrite($TheFileHandle, $email_text);
	fclose($TheFileHandle);
}
//---  End of addition: Ultimate HTML Emails  ---//

	  tep_mail($firstname . ' ' . $lastname, $email_address, EMAIL_SUBJECT, $email_text, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

And this is the code from the html template file.
<?php
/*
================================================================================
=========
This module does one thing: It creates the contents of the html email in the variable $html_email.

If you would like to customize this html email you should first make sure you know a bit about html emails.
Here are some liks that might be interesting for you: 

http://www.xavierfrenette.com/articles/css-support-in-webmail/
http://www.alistapart.com/articles/cssemail/
http://www.campaignmonitor.com/blog/archives/2006/03/a_guide_to_css_1.html
http://www.reachcustomersonline.com/content/2004/11/11/09.27.00/index.php
================================================================================
=========
*/
require(DIR_WS_LANGUAGES . $language . '/modules/UHtmlEmails/' . 'standard_create_account.php');
$ArrayLNTargets = array("\r\n", "\n\r", "\n", "\r", "\t"); //This will be used for taking away linefeeds with str_replace() throughout the mail. Tabs is invisible so we take them away to

$HTMLMailMainContent = str_replace($ArrayLNTargets, '<br />', UHE_WELCOME . UHE_TEXT . UHE_CONTACT . UHE_WARNING);

	  if (ACCOUNT_GENDER == 'true') {
		 if ($gender == 'm') {
		   $HTMLGreet = sprintf(trim(UHE_GREET_MR), $lastname);
		 } else {
		   $HTMLGreet = sprintf(trim(UHE_GREET_MS), $lastname);
		 }
	  } else {
		$HTMLGreet = sprintf(trim(UHE_GREET_NONE), $firstname.' '.$lastname);
	  }
	
$html_email = '<html>
<head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></head>
<body width="750" style="margin: 0px; padding: 0px; background-color:#666666;">
<font face="Arial, Verdana, serif">

<table width="750px" height="121px" border="0" cellpadding="0" cellspacing="0" align="center"><tr><td valign="bottom" align="center"><img src="http://www.puzzledrop.co.uk/images/'.STORE_LOGO.'" width="750" height="121"></td></tr>
<tr><td><div style="font-size: 12px; padding: 14px; border-style:solid; border-width: 0px; border-color: #666666; background-color:#FFFFFF;">
<span style="font-size: 12px;">'.$HTMLGreet.'</span><br/><br/>'. $HTMLMailMainContent.'</div></td></tr>
</table>
</body>
</html>';


$html_email = str_replace($ArrayLNTargets, '', $html_email);

?>

would the str_replace be removing them do you think or have I boobed somewhere else do you think??

Thanks

Mark
Lifes a bitch, then you marry one, then you die!

#9   jan64

jan64
  • Members
  • 133 posts
  • Real Name:Jan Swart
  • Gender:Male
  • Location:Holland

Posted 20 March 2008 - 20:31

Hello,

I have the same problems, i also sent name and password in the first mail to the customer.
That works OK now.

The big problem is that i use points reward, track and trace code and discount coupon.
I can't integrate this content in orders_Forest Green.php.

Can you tellme where i can submit the code in the file.
It doesn't work when i edit the language file.
And when delete the code in the language file, it doesn't send the information to the customer.

Hope to hear something.

Kind regards,
Jan
Dreams can come true, if you help them a littlebit

#10   mark27uk3

mark27uk3
  • Members
  • 1,547 posts
  • Real Name:Mark
  • Gender:Male
  • Location:24-7 Mobile Accessories

Posted 21 March 2008 - 22:54

Hello,

I have the same problems, i also sent name and password in the first mail to the customer.
That works OK now.

The big problem is that i use points reward, track and trace code and discount coupon.
I can't integrate this content in orders_Forest Green.php.

Can you tellme where i can submit the code in the file.
It doesn't work when i edit the language file.
And when delete the code in the language file, it doesn't send the information to the customer.

Hope to hear something.

Kind regards,
Jan


Hi Jan,

Are you able to shed any light on what you did to fix the name and password being added to the email.

I am not sure how the track and trace module works but I have managed to integrate this Tracking Module which supercedes the Royal Mail Track & Trace module quite successfully with the order process email.

This is my line from admin>orders.php

$email = STORE_NAME . "\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" . sprintf(EMAIL_TEXT_STATUS_UPDATE, $orders_status_array[$status]) ."\n\n"  . $tracking->email_add_tracking()."\n" . $notify_comments . "\n" . EMAIL_TEXT_REGARDS;

Mark
Lifes a bitch, then you marry one, then you die!

#11   Olof Larsson

Olof Larsson
  • Members
  • 91 posts
  • Real Name:Olof Larsson
  • Gender:Male
  • Location:Sweden

Posted 22 March 2008 - 09:30

Hi Jan,
Yes the order updates sent out from the admin panel, when you for example updates the order status, are in new layout.

However: The current 1.1 version does not alter the layour for password recoveries or tell a friend emails.

Hi,

this is exactly the contri where i was looking for.

Question, the order update's are they also in a new layout?

kind regards,
Jan



#12   Olof Larsson

Olof Larsson
  • Members
  • 91 posts
  • Real Name:Olof Larsson
  • Gender:Male
  • Location:Sweden

Posted 22 March 2008 - 09:40

Hello and thank you Kbking /rolleyes.gif' class='bbc_emoticon' alt=':rolleyes:' />
The U HTML contribution is adaped for OSC MS2.2 [rc2] and will work without problem with [Rc2a] as [Rc2a] "only" is a compatibility update.

I think it is quiet unlikeley that other contributions will interfere.
This is what the installation file say:

Step1: BACKUP
Step2: The database is changed (a minor addition to add configuration keys)
Step3: Some nonreplaceing files are added
Step4: 2 code blocks are added in "catalog/create_account.php"
Step5: 2 code blocks are added in "catalog/checkout_process.php"
Step6: 2 code blocks are added in "catalog/admin/orders.php"
Step7: 1 code blocks are added in "catalog/admin/includes/functions/general.php"

Step 1, 2 and 3 can not interfere.
Step 7 is just an addition of a function and this cant intrefere either.

What is done in "catalog/create_account.php", "catalog/checkout_process.php","catalog/admin/orders.php" is adding a pice of code around the places where the email content is beeing generated så html content is generated through the contribution instead.

What possibly could go wrong is if you have altered the tep_mail function or something.

Good luck /thumbsup.gif' class='bbc_emoticon' alt=':thumbsup:' />

Hej, Olof!

Det är användbara och kreativa tillägg du komponerar. Min eloge! Now better stick to the English language for the benefit of other community members.

Would this fit into a v. 2.2 patched with RC1 and RC2?

How likely is it that other contributions installed will interfere?

Are there any other prerequisites that has to be met?

Regards!



#13   Olof Larsson

Olof Larsson
  • Members
  • 91 posts
  • Real Name:Olof Larsson
  • Gender:Male
  • Location:Sweden

Posted 22 March 2008 - 09:44

Thatnk you very much!
It's an honor participate in the Open Source community /wink.gif' class='bbc_emoticon' alt=';)' />

I just looked at this and Its a very nice addon. It really will add a professional touch to any store. I like that it doesnt have to create any extra database table like some other one does.
Thanks for giving us this.



#14   Olof Larsson

Olof Larsson
  • Members
  • 91 posts
  • Real Name:Olof Larsson
  • Gender:Male
  • Location:Sweden

Posted 22 March 2008 - 12:40

Hi All,

I added this contribution last night and it works like a bloomin charm. However I do have one strange issue.

Our checkout process is highly modified and it sends a system generated password to the customer in the welcome email. The issue is that all information is present in the welcome email apart from the customers login and password details

... ...

would the str_replace be removing them do you think or have I boobed somewhere else do you think??

Thanks

Mark


Hi Mark!
U HTML emails takes over the whole creation of the email contents.
You see this if statement:
//---  Beginning of addition: Ultimate HTML Emails  ---//
if (EMAIL_USE_HTML == 'true') {
	require(DIR_WS_MODULES . 'UHtmlEmails/create_account_'. ULTIMATE_HTML_EMAIL_LAYOUT .'.php');
	$email_text = $html_email;
}else{
//---  End of addition: Ultimate HTML Emails  ---//

... right?
The loaded module creates the email into the string $html_email. And $email_text = $html_email;.
So your code:
$email_text = sprintf(EMAIL_GREET_NONE, $firstname . ' ' . $lastname) . EMAIL_TEXT0 . sprintf(EMAIL_LOGIN, $email_address) . sprintf(EMAIL_PASSWORD, $new_password) . EMAIL_TEXT1 . EMAIL_WARNING;
will never be reached.

You should do this if you can:
Create a new email layout for U HTML EMAIL which contains
Your:
EMAIL_TEXT0 . sprintf(EMAIL_LOGIN, $email_address) . sprintf(EMAIL_PASSWORD, $new_password) . EMAIL_TEXT1 .

If that is to complicated modify an existing layout.

Hope that will make it work for you.
Regards Olof

#15   mark27uk3

mark27uk3
  • Members
  • 1,547 posts
  • Real Name:Mark
  • Gender:Male
  • Location:24-7 Mobile Accessories

Posted 22 March 2008 - 13:05

Hi Mark!
U HTML emails takes over the whole creation of the email contents.
You see this if statement:

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

... right?
The loaded module creates the email into the string $html_email. And $email_text = $html_email;.
So your code:
$email_text = sprintf(EMAIL_GREET_NONE, $firstname . ' ' . $lastname) . EMAIL_TEXT0 . sprintf(EMAIL_LOGIN, $email_address) . sprintf(EMAIL_PASSWORD, $new_password) . EMAIL_TEXT1 . EMAIL_WARNING;
will never be reached.

You should do this if you can:
Create a new email layout for U HTML EMAIL which contains
Your:
EMAIL_TEXT0 . sprintf(EMAIL_LOGIN, $email_address) . sprintf(EMAIL_PASSWORD, $new_password) . EMAIL_TEXT1 .

If that is to complicated modify an existing layout.

Hope that will make it work for you.
Regards Olof


Hi Olof,

Thanks for the point in the right direction.

In the end all I had to do was add the login and password calls before this :

'. $HTMLMailMainContent.'

in the template. Happy Days /thumbsup.gif' class='bbc_emoticon' alt=':thumbsup:' />

Mark
Lifes a bitch, then you marry one, then you die!

#16   Olof Larsson

Olof Larsson
  • Members
  • 91 posts
  • Real Name:Olof Larsson
  • Gender:Male
  • Location:Sweden

Posted 22 March 2008 - 13:53

Hello Friends,
People has asked what to do if they have other contributions added to their store that sends information via emails to the customer.
Here are my thought on this topic:

To begin with it is important to know that U HTML Emails overrides the usual contents of the emails. Even the corresponding languagefiles are new.
What I've done is wrapping the code that generates the email content in an "ifelse"-statement. That statement looks like this.

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

This is done in three files (as of version 1.1):
"catalog/create_account.php"
"catalog/checkout_process.php"
"catalog/admin/orders.php"

if EMAIL_USE_HTML is set to 'true' the email content will be generated entirely from the module of selected layout.

OK that was some background information.
Let's get to the point:

Let's say you are using the layout "Basic" and you would like to have some additional text in the email sent from create_account.php. This additional text comes from a contribution that putts for example the customers password in the email. You should then create a new layout that is a copy of the "Basic" layout. And for example call it "Basic for my password contribution". This is done by copying the the modulefiles and renaming the suffix in the filename (the suffix is the contribution name).

For example the copy of
catalog/includes/modules/UHtmlEmails/create_account_Basic.php
Should be called
catalog/includes/modules/UHtmlEmails/create_account_Basic for my password contribution.php

You should then alter this new file so it inserts the text you want when generating the email.

A good thing to know: All variables that can be reached from "catalog/create_account.php" can be reached from withing the create_account_Basic for my password contribution.php file. So perhaps there is no need to modify the languagefiles for U HTML Email.

In case you would like to add definittions to the languagefiles this is what should be done:

How to change the languagefiles for a layout
As I said before it is important to know that U HTML Emails overrides the usual contents of the emails. Even the corresponding languagefiles are new.

The languagefiles are included in the email content generation module. Lets take a look att the file "catalog/includes/modules/UHtmlEmails/create_account_Basic.php"

This is the very first (non-comment) line:
require(DIR_FS_CATALOG . DIR_WS_LANGUAGES . $language . '/modules/UHtmlEmails/' . 'standard_create_account.php');
As we can see the languagefile "standard_create_account.php" is used and this is a new file added by the contribution. My opinion is that we should try to keep the standard_create_account.php-file clean. Lets make a copy of it called "create_account_Basic for my password contribution.php" and add the new lines in that copy instead.

After that we change the
require(DIR_FS_CATALOG . DIR_WS_LANGUAGES . $language . '/modules/UHtmlEmails/' . 'standard_create_account.php');
To:
require(DIR_FS_CATALOG . DIR_WS_LANGUAGES . $language . '/modules/UHtmlEmails/' . 'create_account_Basic for my password contribution.php');

Question Why Should I just not add the lines to standard_create_account.php?
Answer:
Well that is a simple and good solution acctually. /thumbsup.gif' class='bbc_emoticon' alt=':thumbsup:' />
But let's say that you have sepparated the code to completely new files, and you have done a great job fixing a layout that works with some other contribution that modifies the content of emails. You could then uppload this layout and it could eaily be installed without interfering with other code.

Well well... /rolleyes.gif' class='bbc_emoticon' alt=':rolleyes:' />
Any questions or ideas on these thoughts?

#17   usvi4me

usvi4me
  • Members
  • 127 posts
  • Real Name:Letty

Posted 22 March 2008 - 15:36

I just installed this software

When I try to change the U-html-Emails Layout from basic to green, I get the following error:

Fatal error: Call to undefined function: tep_cfg_pull_down_uhtml_email_layout_list() in /home/mywebsite/public_html/admin/configuration.php(125) : eval()'d code on line 1

Anyone any suggestions ??

#18   mark27uk3

mark27uk3
  • Members
  • 1,547 posts
  • Real Name:Mark
  • Gender:Male
  • Location:24-7 Mobile Accessories

Posted 22 March 2008 - 18:16

Hi Olof,

Great guide, maybe you should add this to the download.

Ok next issue which I can not seem to resolve urgh

Our store uses the 'Separate Pricing Per Customer' mod and I thought heh why not add a notify field to send the customer an email when their group status changes. So I did and the email generates perfectly (using debug mode) except that it does not send the email.

This is the code I have in admin>customers.php

if (isset($HTTP_POST_VARS['notify']) && ($HTTP_POST_VARS['notify'] == 'on')) {

//---  Beginning of addition: Ultimate HTML Emails  ---//
if (EMAIL_USE_HTML == 'true') {
	require(DIR_FS_CATALOG_MODULES . 'UHtmlEmails/group_update_'. ULTIMATE_HTML_EMAIL_LAYOUT .'.php');
	$email = $html_email;
}else{//Send text email
//---  End of addition: Ultimate HTML Emails  ---//
			
//---  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 = DIR_FS_CATALOG . 'Last_mail_from_orders.php.htm';
	$TheFileHandle = fopen($TheFileName, 'w') or die("can't open error log file");
	fwrite($TheFileHandle, $email);
	fclose($TheFileHandle);
}
//---  End of addition: Ultimate HTML Emails  ---//

			tep_mail($customers['customers_firstname'], $customers['customers_email_address'], EMAIL_TEXT_SUBJECT, $email, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

		  }

Is my tep_mail function correct ?????

Thanks

Mark
Lifes a bitch, then you marry one, then you die!

#19   Olof Larsson

Olof Larsson
  • Members
  • 91 posts
  • Real Name:Olof Larsson
  • Gender:Male
  • Location:Sweden

Posted 22 March 2008 - 21:53

Greetings usvi4me,
That error message means that the function tep_cfg_pull_down_uhtml_email_layout_list() does not exist in the file
/home/mywebsite/public_html/admin/includes/functions/general.php
I can tell because that function is one that comes with my contribution.

You must have forgotten to add that function to the file. /wink.gif' class='bbc_emoticon' alt=';)' />

I have a good adivce for you: Download and get to know the program "Beyond Compare". Please do this. It will make camparing files very easy. This program is not free but you can use it as normal during 30 days. If you do not like to pay you can then use the program WinDiff, which is free, but not as good.

Regards,
Olof Larsson

I just installed this software

When I try to change the U-html-Emails Layout from basic to green, I get the following error:

Fatal error: Call to undefined function: tep_cfg_pull_down_uhtml_email_layout_list() in /home/mywebsite/public_html/admin/configuration.php(125) : eval()'d code on line 1

Anyone any suggestions ??



#20   Olof Larsson

Olof Larsson
  • Members
  • 91 posts
  • Real Name:Olof Larsson
  • Gender:Male
  • Location:Sweden

Posted 22 March 2008 - 22:08

Hi mark27uk3,
Nice to see you are understanding how to use the pluggin /thumbsup.gif' class='bbc_emoticon' alt=':thumbsup:' />
I mean sending UHTMLMails from an new file (customers.php) and you create a new module for this useing the pattern supposed to be used.

Well can't honestly see no problems with your tep_mail function.
The tep_mail code will clearly be parsed as you say that the code for outputting the dubug prewiev is reached... and you get no error message...

Perhaps:
You have set "Configuration" --> "E-Mail Options" --> "Send E-Mails" = false
This should be set to true.
Is that the solution?


Hi Olof,

Great guide, maybe you should add this to the download.

Ok next issue which I can not seem to resolve urgh

Our store uses the 'Separate Pricing Per Customer' mod and I thought heh why not add a notify field to send the customer an email when their group status changes. So I did and the email generates perfectly (using debug mode) except that it does not send the email.

This is the code I have in admin>customers.php

if (isset($HTTP_POST_VARS['notify']) && ($HTTP_POST_VARS['notify'] == 'on')) {

//---  Beginning of addition: Ultimate HTML Emails  ---//
if (EMAIL_USE_HTML == 'true') {
	require(DIR_FS_CATALOG_MODULES . 'UHtmlEmails/group_update_'. ULTIMATE_HTML_EMAIL_LAYOUT .'.php');
	$email = $html_email;
}else{//Send text email
//---  End of addition: Ultimate HTML Emails  ---//
			
//---  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 = DIR_FS_CATALOG . 'Last_mail_from_orders.php.htm';
	$TheFileHandle = fopen($TheFileName, 'w') or die("can't open error log file");
	fwrite($TheFileHandle, $email);
	fclose($TheFileHandle);
}
//---  End of addition: Ultimate HTML Emails  ---//

			tep_mail($customers['customers_firstname'], $customers['customers_email_address'], EMAIL_TEXT_SUBJECT, $email, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

		  }

Is my tep_mail function correct ?????

Thanks

Mark