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

Newsletter Bug Fix / Mod

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #1  
Old 11-26-2003, 03:01 AM
  carlisleglass's Avatar 
carlisleglass carlisleglass is offline
 

eXpert
  
Join Date: Aug 2003
Location: Carlisle, UK
Posts: 316
 

Default Newsletter Bug Fix / Mod

This is really a bug fix with a mod.

The newsletter sends out the text mail templates regardless if you select it to send as a html email.

Thats the bug .... now the mod bit

The ability to send a newsletter with a header AS WELL as a signature.

add a template called newsletter_header.tpl in /skin1/mail/html/ and put whatever header you want in it ... your signature bit (footer) is in /skin1/mail/html/newsletter_signature.tpl update that as well, to match your design.

now for the code change ... in /xcart/admin/newsletter_modify.php

change
Code:
$signature = $smarty->fetch("mail/newsletter_signature.tpl");
to
Code:
$header = $smarty->fetch("mail/html/newsletter_header.tpl"); $signature = $smarty->fetch("mail/html/newsletter_signature.tpl");


If you use the internal PHP mailer .. change the following ...
Code:
func_send_simple_mail($value, $subject, $body."\n\n".preg_replace("/$email_spec/", "$value", $signature), $config["Company"]["newsletter_email"]);
to
Code:
func_send_simple_mail($value, $subject, $header."\n\n".$body."\n\n".preg_replace("/$email_spec/", "$value", $signature), $config["Company"]["newsletter_email"]);


If you don't use the internal PHP mailer .. change the following
Code:
func_write_array($body_file,$body."\n\n".$signature);
to
Code:
func_write_array($body_file,$header."\n\n".$body."\n\n".$signature);

I recommend you change all the file regardless of which system you use.
__________________
Darren Kierman
Carlisle Glass (http://www.carlisleglass.co.uk/)
... running X-Cart Gold 4.4.5 [unix]
Reply With Quote
  #2  
Old 12-11-2005, 07:54 PM
 
extreme extreme is offline
 

Member
  
Join Date: Jun 2005
Posts: 28
 

Default

Not sure what version that was for but I couldn't find those particular files in 4.0.16. However, it was enough to get me started and I eventually got it working as follows:

Add a template called newsletter_header.tpl in /skin1/mail/html/ (I just cloned my mail_header.tpl as I wanted it basically the same)

Then open modules/news management/news_send.php and edit the following:

Add

Code:
$header_template = "mail/newsletter_header.tpl";

just before

Code:
$signature_template = "mail/newsletter_signature.tpl";

And then add

Code:
$header = func_display($header_template,$smarty,false);

just before

Code:
$signature = func_display($signature_template,$smarty,false);

Add

Code:
$header_template = "mail/html/".basename($header_template);

before

Code:
$signature_template = "mail/html/".basename($signature_template);

and lastly, change

Code:
foreach($recipients as $recipient) { func_send_simple_mail($recipient, $message["subject"], $message["body"].$sign_delim.preg_replace("/$email_spec/", $recipient, $signature), $config["Company"]["newsletter_email"]); }

to

Code:
foreach($recipients as $recipient) { func_send_simple_mail($recipient, $message["subject"], $header.$message["body"].$sign_delim.preg_replace("/$email_spec/", $recipient, $signature), $config["Company"]["newsletter_email"]); }

___________________
X-Cart Gold v. 4.0.16
Reply With Quote
  #3  
Old 12-12-2005, 05:29 AM
  carlisleglass's Avatar 
carlisleglass carlisleglass is offline
 

eXpert
  
Join Date: Aug 2003
Location: Carlisle, UK
Posts: 316
 

Default

Hi Extreme,

I dont remember which version this coding was for either - I wrote that post 2 years ago. Think i coded it when i was using v3 of xcart.
__________________
Darren Kierman
Carlisle Glass (http://www.carlisleglass.co.uk/)
... running X-Cart Gold 4.4.5 [unix]
Reply With Quote

The following user thanks carlisleglass for this useful post:
supernovia (07-15-2009)
Reply
   X-Cart forums > X-Cart 4 > Dev Questions


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 05:05 PM.

   

 
X-Cart forums © 2001-2020