[mod] Confirmation emails in HTML format

3rd party code for phpList

Postby Heritage » 4:49pm, Wed 20 Feb, 2008

Did anyone suggest the ability to have html system messages to be a feature in the next release?

Since some only want txt, it might be a good thing to have a toggle in the config for this feature.

I have received complaints that the system messages are not professional enough out of the box. I think they are speaking about it being just Text.
Heritage
Moderator
 
Posts: 223
Joined: 3:25pm, Fri 23 Jun, 2006
Location: 800 720-7301

Postby BWWD2008 » 5:23pm, Wed 20 Feb, 2008

I agree
BWWD2008
PL Nut
 
Posts: 33
Joined: 4:08am, Sat 09 Feb, 2008

Postby rdohn » 12:16am, Tue 18 Mar, 2008

Preach on...

Same here, I HAVE to have HTML.

BTW, anyone know how to modify the "thank you" page so it's different for each list?
rdohn
phpLister
 
Posts: 9
Joined: 7:56am, Mon 17 Mar, 2008

try this

Postby springchicken » 11:21am, Thu 05 Jun, 2008

// customisation to allow HTML in system messages
$message = stripslashes(stripslashes($message));
$html_message = $message;
$message = preg_replace('/(<script>)|(<style>)/i', '', $message);
$message = preg_replace('/<a>(.*?)</a>/i', "$4:\n$2\n", $message);
$message = strip_tags($message);
// end customisation
springchicken
phpList newbie
 
Posts: 1
Joined: 11:12am, Thu 05 Jun, 2008

Postby khan2ims » 3:23pm, Thu 14 Aug, 2008

Hi,

I am again into a very pecular problem. I have done all the necessary edits and changed the text of the Welcome Message.

But the problem is I am still geting the old same Wecome message. If the html was not working atleast the change in text should have showed up !!! Its still showing the default text.

Where should I look up to make necessary changes?
khan2ims
PL Nut
 
Posts: 17
Joined: 12:27pm, Mon 30 Jun, 2008

Postby meancode » 7:19pm, Thu 02 Oct, 2008

I am feeling a little lost after reading through this thread.

I am running phplist version: 2.10.5. What do I have to do to allow the Welcome email to send in HTML format.

Thanks,

Ken
meancode
PL Nut
 
Posts: 26
Joined: 4:19am, Mon 25 Jun, 2007

where to edit

Postby Guest » 7:18pm, Thu 30 Oct, 2008

khan2ims wrote:Hi,

I am again into a very pecular problem. I have done all the necessary edits and changed the text of the Welcome Message.

But the problem is I am still geting the old same Wecome message. If the html was not working atleast the change in text should have showed up !!! Its still showing the default text.

Where should I look up to make necessary changes?


Yup, it confused me -- I made the changes in the configuration section and saw no difference. You need to make the change is on the page where you edit the subscribe page. The various confirm/thank you sections can be changed there.

!!! seems that when someone subscribes on the subscribe page, it uses the info entered on your subscribe page form -- but if one imports subscribers, the confirmation message sent out is the one set in the configuration page.

Cheers
Last edited by Guest on 8:30pm, Fri 31 Oct, 2008, edited 1 time in total.
Guest
 

Re: Working with [VARIABLES]?

Postby Guest » 7:21pm, Thu 30 Oct, 2008

dkellam wrote:Hi,

This hack works fine with HTML, but does not seem to support the phplist [VARIABLES], such as [NAME]. How would one modify this to do that?

Thanks,

David


Any one have an answer? the [CONFIRMATIONURL]& [LISTS] do come through OK, but [EMAIL] AND [FORWARD] don't.

Cheers
Guest
 

Re: I've used this code to allow html system messages

Postby Guest » 5:15pm, Fri 31 Oct, 2008

EvilPuppetMaster wrote:This is for 2.10.2, haven't tested in 2.10.3. No guarantees that it won't break anything, use at your own risk and test thoroughly!

You just need to make some modifications to the sendMailPhpMailer() function in the /admin/lib.php file. Once this is done, simply enter the raw html you want into the fields for 'Message users receive when they subscribe' etc. You can also enter HTML for any of the system emails that can be edited on the configuration page. The script will automatically send both html and text only versions of the email, for those email clients that don't support HTML. Note that the text-only version is made by simply stripping all the html tags so it won't look pretty unless you take care that the message still has line breaks in the right place when the html is stripped.

Anyway, on to the code!




This works great, thanks... in one way but not another. When the subscribe page is used, the confirmation email goes out great -- this is the one where the html code is included in the "subscribe pages" form. However, the exact same html, placed in the confirmation area on the configuration page, and which is the source for confirmation emails for emails that are imported, causes the email to be sent in html but.... The text looks mostly like txt text though some is colored in different colors to the color defined in the code.

The source of the email still has all the \s in it e.g. <IMG SRC="........." WIDTH="650" HEIGHT="525" ALIGN="BOTTOM"

They haven't been removed. I've done the changes suggested by evilpuppetmaster and RJC. I also went ahead and made similar changes to those by RJC in import1.php and import3.php.

Anyone got a solution to this, please... I have over a thousand emails to import and I'd hate to have to do one-by-one through the subscribe page?

--------------------------------------------
Update -- this is crazy -- I have been importing my emails with the "import emails with different values for attributes." option since I want to include each person's location. I tried an import with just email address, using the "import emails with the same values for attributes." option, and lo and behold, the confirmation email is perfect. So what's going on that the one confirmation doesn't strip the \s, but the other does. :?: I guess I'm going to have to go ahead with just email addresses.
Last edited by Guest on 6:27pm, Sat 01 Nov, 2008, edited 3 times in total.
Guest
 

Re: try this

Postby Guest » 2:27am, Sat 01 Nov, 2008

springchicken wrote:// customisation to allow HTML in system messages
$message = stripslashes(stripslashes($message));
$html_message = $message;
$message = preg_replace('/(<script>)|(<style>)/i', '', $message);
$message = preg_replace('/<a>(.*?)</a>/i', "$4:\n$2\n", $message);
$message = strip_tags($message);
// end customisation



I tried thsi change - it ends up giving a blank page when trying to subscribe
Guest
 

Re: I've used this code to allow html system messages

Postby Guest » 3:37am, Thu 06 Nov, 2008

EvilPuppetMaster wrote:This is for 2.10.2, haven't tested in 2.10.3. No guarantees that it won't break anything, use at your own risk and test thoroughly!

You just need to make some modifications to the sendMailPhpMailer() function in the /admin/lib.php file. Once this is done, simply enter the raw html you want into the fields for 'Message users receive when they subscribe' etc. You can also enter HTML for any of the system emails that can be edited on the configuration page. The script will automatically send both html and text only versions of the email, for those email clients that don't support HTML. Note that the text-only version is made by simply stripping all the html tags so it won't look pretty unless you take care that the message still has line breaks in the right place when the html is stripped.

Anyway, on to the code!

In /admin/lib.php, find the sendMailPhpMailer() function, about line 246, and change it to the below. Lines that I've changed from the original have been commented with //customisation:



This does not seem to work in 2.10.7. I've made modifications, and I get an HTML confirmation message, but any tags I put in the message in the configuration page do not show up in the resulting email. All I get is the original text. Viewing the source, I can see both the plain text section and the html section, but there are no tags there.

Ideas?

Steve
Guest
 

Re: I've used this code to allow html system messages

Postby Guest » 4:29am, Thu 06 Nov, 2008

sweigold wrote:
In /admin/lib.php, This does not seem to work in 2.10.7. I've made modifications, and I get an HTML confirmation message, but any tags I put in the message in the configuration page do not show up in the resulting email. All I get is the original text. Viewing the source, I can see both the plain text section and the html section, but there are no tags there.

Ideas?

Steve


What specific tags are you refering to?
Guest
 

Postby Guest » 7:05pm, Thu 06 Nov, 2008

The HTML formatting tags. The message comes through with two parts, one specified as plain text, the other as text/html but there are no actual html tags there.

I looked at the modifications to the code closely. It almost looks like something is stripping the tags out of $message before it gets to the sendMailPhpMailer routine so that they've already been removed before the html_message value is assigned. I don't know if that's whats really happening or not. It just a guess based on how the code appears to work.

Steve
Guest
 

Postby Guest » 7:30pm, Thu 06 Nov, 2008

sweigold wrote:The HTML formatting tags. The message comes through with two parts, one specified as plain text, the other as text/html but there are no actual html tags there.

I looked at the modifications to the code closely. It almost looks like something is stripping the tags out of $message before it gets to the sendMailPhpMailer routine so that they've already been removed before the html_message value is assigned. I don't know if that's whats really happening or not. It just a guess based on how the code appears to work.

Steve


Reread my post 5:15pm, Fri 31 Oct, 2008 - I think you had a problem I had -- the problem is that there are two place where you need to code.

For confirmations as a result of someone subscribing at your subscribe page, the source of your confirmation is defined on the page where you set up your subscribe page, NOT on the configuration page.

The configuration page is the sourc of confirmation emails that are sent as a result of new subscribers being imported.

Why there are two different source is beyond me, but it is what it is....
Guest
 

Postby Guest » 9:24pm, Thu 06 Nov, 2008

You're right, I did have the problem you had. I didn't even realize that the message had two places to customize. That is definitely strange. I actually like the idea of being able to have a list specific confirmation message. I guess I'm going to have to test carefully to see which one gets sent in which case.

Funny thing is, I read your post probably fifty times and thought it was similar but not the same... :oops:

I have about 1200 emails to import and I want to use the differing attributes if I can so that in the long run I can have additional data in the database that phplist doesn't need.

I wonder if the issue you mention where one method strips / and one doesn't is still there.

Thanks for responding. I'm going to do additional testing and I'll report back.
Guest
 

PreviousNext

Return to Contributions: Plug-ins, Add-ons, Mods

Who is online

Users browsing this forum: No registered users and 1 guest

cron