[mod] Confirmation emails in HTML format

3rd party code for phpList

Re: [mod] Confirmation emails in HTML format

Postby sardos » 11:52pm, Mon 16 Nov, 2009

Got this working.

The summary above misses a couple of extra customisations in admin/lib.php which was in the original post by EvilPuppetMaster.

The relevant section that works for me:

Code: Select all
        // customisation to allow HTML in system messages
      $html_message = $message;
      $message = preg_replace('/(<script.*\/script>)|(<style.*\/style>)/i', '', $message);
      $message = preg_replace('/<a\s*.*?href\s*=\s*("|\')([^"\']*?)("|\').*?>(.*?)<\/a>/i', "$4:\n$2\n", $message);
      $message = strip_tags($message);
      // end customisation
 
  if (!ereg("dev",VERSION)) {
    $mail = new PHPlistMailer('systemmessage',$to);
    $destinationemail = $to;
   $mail->add_html($html_message); // customisation
    $mail->add_text($message);
  } else {
    # send mails to one place when running a test version
    $message = "To: $to\n".$message;
    if ($GLOBALS["developer_email"]) {
      # fake occasional failure
      if (mt_rand(0,50) == 1) {
        return 0;
      } else {
        $mail = new PHPlistMailer('systemmessage',$GLOBALS["developer_email"]);
      $mail->add_html($html_message); // customisation
        $mail->add_text($message);
        $destinationemail = $GLOBALS["developer_email"];
      }
sardos
phpList newbie
 
Posts: 2
Joined: 9:00am, Mon 16 Nov, 2009

Re: [mod] Confirmation emails in HTML format

Postby ameoba » 10:05am, Thu 30 Dec, 2010

it seems that you need to add 2 more line of code, when user change the email address, the system will issues 2 emails - which requires stripslashes() functions:

file subscribelib2.php

After
Code: Select all
 $newaddressmessage = ereg_replace('\[CONFIRMATIONINFO\]', getUserConfig("emailchanged_text",$userid), $message);
 $oldaddressmessage = ereg_replace('\[CONFIRMATIONINFO\]', getUserConfig("emailchanged_text_oldaddress",$userid), $message);


Add
Code: Select all
 $newaddressmessage = stripslashes($newaddressmessage);  // Needed so html email will display properly; ie converts \" to "
 $oldaddressmessage = stripslashes($oldaddressmessage);  // Needed so html email will display properly; ie converts \" to "
ameoba
phpList newbie
 
Posts: 4
Joined: 7:43am, Fri 26 Nov, 2010

Re: [mod] Confirmation emails in HTML format

Postby michal » 8:11am, Sat 05 Feb, 2011

woooooooooorks for 2.10.10

Thanks!!!!!!!!!!!!!
:D :D :D :D :D
michal
PL Nut
 
Posts: 19
Joined: 6:57am, Mon 31 May, 2010

Re: [mod] Confirmation emails in HTML format

Postby norvis » 5:31pm, Sat 14 May, 2011

Soy de el salvador tengo la versión 2.10.12 y funciona a bien gracias a todos....
norvis
phpList newbie
 
Posts: 3
Joined: 2:34pm, Sat 14 May, 2011

Re: [mod] Confirmation emails in HTML format

Postby pascalato » 10:52am, Tue 03 Jan, 2012

works for 2.10.17
pascalato
phpList newbie
 
Posts: 1
Joined: 10:51am, Tue 03 Jan, 2012

Re: [mod] Confirmation emails in HTML format

Postby kristiqn » 9:50pm, Mon 12 Mar, 2012

Hi all.
Thanks for the great mod.

Works fine in 2.10.17 but with:
http://forums.phplist.com/viewtopic.php?f=7&t=6944&start=45#p70136
kristiqn
phpList newbie
 
Posts: 1
Joined: 9:17pm, Mon 12 Mar, 2012

Re: [mod] Confirmation emails in HTML format

Postby gallenkamp » 8:43pm, Wed 24 Oct, 2012

Hi everyone,

I tried the last solution with 2.10.19, but I can't get it to work.

Maybe this is because I send emails via SMTP, I cant tell. With these settings:

Code: Select all
define("PHPMAILER",1);
define("PHPMAILERHOST",'smtp.***');


When I set PHPMAILER to 0, the edited function will not be called, right? So where do I have to edit then?

Best regards,

Guido
gallenkamp
phpLister
 
Posts: 6
Joined: 8:35pm, Wed 24 Oct, 2012

Re: [mod] Confirmation emails in HTML format

Postby AlexLifeson » 7:20pm, Thu 13 Dec, 2012

Any one using 2.10.19 having success with EvilPuppet and rjc mod? After following EvilPuppet and rjc mods for allowing html into the system messaging, the mod will not pick up the html placed. Once the system sends the email and it is opened, all html between all <> is missing. Any text that is not between <> is viewable in the system sent message. Is my question / issue understood??? I have a tendency not to explain my issues to where they are understood.

Would any one point me in the correct direction here?
AlexLifeson
PL Nut
 
Posts: 18
Joined: 2:57pm, Tue 11 Dec, 2012

Re: [mod] Confirmation emails in HTML format

Postby AlexLifeson » 1:38pm, Tue 18 Dec, 2012

I'm still in a fog cloud here, would any one have any words of direction to share with me to solve this issue. Thanks to AnyOne who replies.

Alex
AlexLifeson
PL Nut
 
Posts: 18
Joined: 2:57pm, Tue 11 Dec, 2012

Re: [mod] Confirmation emails in HTML format

Postby AlanGeorge » 2:26pm, Tue 18 Dec, 2012

Hi Alex

I've installed the puppetmaster code and updates and have had no problems and have also added further modifications to suit my requirements all of which have been working since version 2.10.17.
My coding (parts 1-3) can be viewed at the following address
http://www.alangeorge-photography.com/listCode_001.php
follow the links on the Coding++ drop down menu.

To view the messages check out the last 6 samples on this page
http://www.alangeorge-photography.com/lists/archive.php?listID=4

The message in the "Subscribe Page" i.e. Message they receive when they Subscribe should be constructed as per a normal webPage i.e with html and body tags.

regards

Alan
AlanGeorge
PL Geek
 
Posts: 97
Joined: 7:14pm, Tue 28 Feb, 2012

Re: [mod] Confirmation emails in HTML format

Postby Yuu » 4:16am, Tue 07 May, 2013

This does not seem to be working for phplist 2.10.19. I have tried Alan's method and it is still sending the original test system message. Has there been a fix for this or if anyone could help I'm sure there is a lot of people out there like myself looking for a fix and I'm sure this community would be greatful of any help as I would. Thank you.
Yuu
phpLister
 
Posts: 7
Joined: 8:16am, Sun 28 Apr, 2013

Re: [mod] Confirmation emails in HTML format

Postby AlanGeorge » 7:21am, Tue 07 May, 2013

Hi Yuu

the html hack that I have documented is a result of piecing together all the previous postings to the forum from "evilpuppet master, sardos and ameoba" and making them all available in one file. These modifications have been tested using 2.10.17 , 18 and are working with my installed version of 2.10.19.

Can you verify that you have completed the following steps and provide a copy of the message you have embedded into your CONFIGURE page...

Installation
------------------
1. Copy the modified files to your server.
lists/index.php
lists/admin/lib.php
lists/admin/subscribelib2.php
lists/admin/import1.php
lists/admin/import3.php
lists/admin/reconcileusers.php
lists/admin/commonlib/pages/importcsv.php

2. Create the following html eMails
Message users receive when they subscribe - admin - configure page
Message that is sent when users change their information - admin - configure page
Message they receive when they subscribe - admin - Subscribe Page (?)
Message they receive when they confirm their subscription - admin - Subscribe Page
Message users receive when they unsubscribe - admin - configure page (not tried this yet)

3. Update the Subject fields in the admin - Configure Page
Subject of the message users receive when they subscribe
Subject of the message users receive when they unsubscribe
Subject of the message users receive after confirming their email address
Subject of the message users receive when they have changed their details
Subject of message to send when users request their personal location


Regards


Alan
AlanGeorge
PL Geek
 
Posts: 97
Joined: 7:14pm, Tue 28 Feb, 2012

Re: [mod] Confirmation emails in HTML format

Postby Yuu » 7:49am, Tue 07 May, 2013

Thank you for getting back with me. I had followed your directions to the exact details. Another thing I tried to do was manually tried editing the file where the text message is sent from and that did not work either. The funny thing is the message will not change as if there is a cache involved with phplist even after changing the text to something other than the default. I cannot figure it out. Any help would be great. If you have a skype you can chat on and pm me, I would also appreciate it. Thanks again.
Last edited by Yuu on 2:20am, Wed 08 May, 2013, edited 1 time in total.
Yuu
phpLister
 
Posts: 7
Joined: 8:16am, Sun 28 Apr, 2013

Re: [mod] Confirmation emails in HTML format

Postby AlanGeorge » 8:21am, Tue 07 May, 2013

Hi

I have skype IM only and that's on a laptop not available at present.

email looks ok apart from the double opening <body> tag, though I doubt that is causing a problem.

Not sure whether this is relevant, have you set the html/Text preferences to html only. I'll do a quick check on mine and see what happens and post a note here later.

regards

Alan
AlanGeorge
PL Geek
 
Posts: 97
Joined: 7:14pm, Tue 28 Feb, 2012

Re: [mod] Confirmation emails in HTML format

Postby Yuu » 8:40am, Tue 07 May, 2013

I believe I had set the emails to html only. What is the location of the setting?
Yuu
phpLister
 
Posts: 7
Joined: 8:16am, Sun 28 Apr, 2013

PreviousNext

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

Who is online

Users browsing this forum: No registered users and 1 guest

cron