Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Plain text email plus HTML attachment

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 09-19-2003, 03:03 AM
 
John_E John_E is offline
 

Member
  
Join Date: Jun 2003
Posts: 15
 

Default Plain text email plus HTML attachment

Hi,

Has anyone coded a mod to xcart that uses one template as the plain text template, then writes a file as an attachment using the other template which is HTML coded?

So when the email is sent from xcart the plain text comes up, and also a html version is attached to the text email?

Just curious, as I think it would be good to suit all customers, both those with just plain text and those with html mail programs.

It would also be a great mod for xcart to put in their future versions.


John_E

(Dream interpreter - Have dream, will interpret)
Reply With Quote
  #2  
Old 09-19-2003, 06:22 AM
  B00MER's Avatar 
B00MER B00MER is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Keller, TX (Cart-Lab.com)
Posts: 3,165
 

Default

Code:
// attachments if($AttmFiles){ foreach($AttmFiles as $AttmFile){ $patharray = explode ("/", $AttmFile); $FileName=$patharray[count($patharray)-1]; $Msg.= "\n--".$OB."\n"; $Msg.="Content-Type: application/octetstream;\n\tname=\"".$FileName."\"\n"; $Msg.="Content-Transfer-Encoding: base64\n"; $Msg.="Content-Disposition: attachment;\n\tfilename=\"".$FileName."\"\n\n"; //file goes here $fd=fopen ($AttmFile, "r"); $FileContent=fread($fd,filesize($AttmFile)); fclose ($fd); $FileContent=chunk_split(base64_encode($FileContent)); $Msg.=$FileContent; $Msg.="\n\n"; } }

The files are attached by an array specified.
$attmFile = Array("/home/sites/blah.com/attachment.jpg");

Found this on www.php.net/mail, sure it could be integrated into include/func.php for what's needed to attach files to the email's sent.
__________________
Cart-Lab - 100+ Social Bookmarks for X-Cart.
Reply With Quote
  #3  
Old 09-22-2003, 02:50 AM
 
John_E John_E is offline
 

Member
  
Join Date: Jun 2003
Posts: 15
 

Default Dynamic attachment files

Thanks for the reply Boomer,

Are we talking dynamic attachment files?

The xcart would need to send the email according to the template, then generate another email, html version, including product code, quanity, price, if invoice for example, or customer data if lost password.

It wouldnt be the same file attachment each time, it would need to generate the attachment file on the fly, call it perhaps Attn: 0001.htm and then attach it to the email.



John_E

(Dream interpreter, have dream, will interpret)
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 06:50 AM.

   

 
X-Cart forums © 2001-2020