X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   Easy fix for sending HTML newsletters but other in plain txt (https://forum.x-cart.com/showthread.php?t=3443)

finestshops 07-03-2003 06:58 AM

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,

manager 10-14-2003 12:58 PM

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

Thanks,
Trevor[/quote]

walteis 10-15-2003 06:08 PM

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

shan 10-16-2003 04:47 AM

from what i hear this will be in V3.5.0

nfc5382 11-11-2003 02:28 PM

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!

nfc5382 12-08-2003 07:33 PM

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


All times are GMT -8. The time now is 08:25 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.