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

Easy fix for sending HTML newsletters but other in plain txt

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #1  
Old 07-03-2003, 06:58 AM
  finestshops's Avatar 
finestshops finestshops is offline
 

eXpert
  
Join Date: Oct 2002
Location: Toronto, Canada
Posts: 335
 

Default Easy fix for sending HTML newsletters but other in plain txt

> Can we send html newsletter in HTML and all other email
> notifications in plain text?

Here is the fix from x-cart support:

Please look at the "General settings" page. If the option 'Use internal PHP mailer for sending newsletters.' is turned OFF, you can try the following modification:

Edit the 'admin/spam.sh' file and replace the line

Code:
(echo "To: $target"; echo "From: $mail_from"; echo "Subject: $mail_subj"; echo; cat $mail_body) | $sendmail_prog $target

with

Code:
(echo "To: $target"; echo "From: $mail_from"; echo "Content-type: text/html"; echo "Subject: $mail_subj"; echo; cat $mail_body) | $sendmail_prog $target

Otherwise, you should modify the 'func_send_simple_mail' function in the 'include/func.php' file. Please rplace the lines

Code:
if ($config["Email"]["html_mail"] == "Y") $headers .= "Content-Type: text/html; charset: ".$charset.$lend; else $headers .= "Content-Type: text/plain; charset: ".$charset.$lend;

with

Code:
if ($config["Email"]["html_mail"] == "Y" || true) $headers .= "Content-Type: text/html; charset: ".$charset.$lend; else $headers .= "Content-Type: text/plain; charset: ".$charset.$lend;

-----------
Modifying 'admin/spam.sh' works fine for me.
This way you do not have to put
in all email templates
just to send html newsletter.

Enjoy,
__________________
Best regards,

Anton Pachkine
finestshops.com/x-cart
Reply With Quote
  #2  
Old 10-14-2003, 12:58 PM
 
manager manager is offline
 

Member
  
Join Date: Jul 2003
Posts: 16
 

Default newsletter mod rules

Tried this worked well and was easy for newbie to do (with your clear instructions).

Thanks,
Trevor[/quote]
Reply With Quote
  #3  
Old 10-15-2003, 06:08 PM
 
walteis walteis is offline
 

Advanced Member
  
Join Date: Jan 2003
Location: USA
Posts: 65
 

Default

Well, I don't see the point of having the "if" statement, as it will always be true as written. So you can probably simplify it to
Code:
$headers .= "Content-Type: text/html; charset: ".$charset.$lend;
and forget the if structure.

Walt
Reply With Quote
  #4  
Old 10-16-2003, 04:47 AM
  shan's Avatar 
shan shan is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Birmingham, UK
Posts: 6,163
 

Default

from what i hear this will be in V3.5.0
__________________
Looking for a reliable X-cart host ?
You wont go wrong with either of these.

EWD Hosting
Hands On Hosting
Reply With Quote
  #5  
Old 11-11-2003, 02:28 PM
 
nfc5382 nfc5382 is offline
 

X-Adept
  
Join Date: Nov 2002
Posts: 477
 

Default Re: Easy fix for sending HTML newsletters but other in plain

Quote:
Originally Posted by 27stars

Edit the 'admin/spam.sh' file and replace the line

Code:
(echo "To: $target"; echo "From: $mail_from"; echo "Subject: $mail_subj"; echo; cat $mail_body) | $sendmail_prog $target

with

Code:
(echo "To: $target"; echo "From: $mail_from"; echo "Content-type: text/html"; echo "Subject: $mail_subj"; echo; cat $mail_body) | $sendmail_prog $target

-----------
Modifying 'admin/spam.sh' works fine for me.
This way you do not have to put
in all email templates
just to send html newsletter.

Enjoy,

works great thanks!
Reply With Quote
  #6  
Old 12-08-2003, 07:33 PM
 
nfc5382 nfc5382 is offline
 

X-Adept
  
Join Date: Nov 2002
Posts: 477
 

Default

This is odd...

I was able to send the newsletter last month no problems with the above mods.


This month I go to send a newsletter and NOTHING is being sent for newsletters. If I remove the mod then the newsletter is sent but in text only. Is there a configuration to sendmail that has possibly changed on my server? Is there a way to check any of this?


I have 3.4.4. Internal php mailer and html mail are NOT checked.

Oh man just when you think somethign is working!@!!!

NOTE: I am able to send an html newsletter if I turn on php mailer and html mail settings. However this screws up the formatting for the standard non-html emails (order confirmations, etc..). I can turn on the settings, send the newsletter, then turn them back off but shouldnt the above mod to spam.sh work?


thanks
nick
Reply With Quote
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 01:36 AM.

   

 
X-Cart forums © 2001-2020