Allow HTML confirmation emails

Questions about Version 3 phpList features (the answer is probably 'Yes!')
Forum rules
Please help the volunteers to help you by supplying the version of phpList you are using, browser & version and if possible, a link to your phpList installation.

Allow HTML confirmation emails

Postby lostnode » 9:51pm, Tue 03 Sep, 2013

THere was a plugin created for an earlier version that allowed Confirmation emails to contain HTML, this day and age this is almost a Must Have feature. Has it been incorprated into v3?
lostnode
PL Nut
 
Posts: 15
Joined: 6:18pm, Fri 23 Aug, 2013

Re: Allow HTML confirmation emails

Postby duncanc » 10:08am, Wed 04 Sep, 2013

Yes, in phplist 3 the "system" messages for confirmation etc use a system template and can contain HTML.
duncanc
Moderator
 
Posts: 2440
Joined: 6:34am, Sat 08 May, 2010
Location: London

Re: Allow HTML confirmation emails

Postby gojo62 » 2:02am, Fri 31 Jan, 2014

How would one go about doing this, is there any examples?
gojo62
phpList newbie
 
Posts: 2
Joined: 1:57am, Fri 31 Jan, 2014

Re: Allow HTML confirmation emails

Postby gojo62 » 4:15am, Fri 31 Jan, 2014

I found this Alan George website so will give it a try
http://www.alangeorge-photography.com/listCode_020.php#
gojo62
phpList newbie
 
Posts: 2
Joined: 1:57am, Fri 31 Jan, 2014

Re: Allow HTML confirmation emails

Postby banditsc » 5:52pm, Mon 14 Apr, 2014

I can't seem to get this working as intended. My problem is in the below code, if I put in the mail-> add_html($html_message); // customisation after the $mail =new PHPListMailer ... as described it doesn't work, all the HTML gets stripped, the IF statement afterwards is taking over. If I get rid of everything in the IF statement it works fine, but non HTML system messages get all the line breaks stripped from them and it looks horrible. What am I doing wrong?

Code: Select all
  list($htmlmessage,$textmessage) = constructSystemMail($message,$subject);

  $mail = new PHPlistMailer('systemmessage',$destinationemail,false);

    if (!empty($htmlmessage)) {
    $mail->add_html($htmlmessage,$textmessage,getConfig('systemmessagetemplate'));
    ## In the above phpMailer strips all tags, which removes the links which are wrapped in < and > by HTML2text
    ## so add it again
    $mail->add_text($textmessage);
  }
  $mail->add_text($textmessage);
banditsc
phpList newbie
 
Posts: 2
Joined: 5:47pm, Mon 14 Apr, 2014

Re: Allow HTML confirmation emails

Postby AlanGeorge » 7:40pm, Mon 14 Apr, 2014

Hi

which version of phpList are you using

which of the system messages are you referring to

can you share the code of the html subscriber messages that you are using

Is there a url that we could possibly look at....

regards

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

Re: Allow HTML confirmation emails

Postby banditsc » 7:54pm, Mon 14 Apr, 2014

I'm running a new 3.05 install. The subscriber messages are actually the ones you have as an example on your website (thanks). When I use your code changes the signup emails are sent without using the HTML wrapper and template, which is ok, so using the $mail-> add_html($html_message); // customisation. But using that also makes all the plain text system messages (such as the subscriber notification to the admin) to be stripped of line breaks.

What I just found as a workaround (I'm sure not the write way to do it), is in the first line of the HTML for the custom subscription emails is <html xmlns=" ... so what I did was below, which sends those emails using your code change and all other emails using the original code.

Code: Select all
  list($htmlmessage,$textmessage) = constructSystemMail($message,$subject);

  $mail = new PHPlistMailer('systemmessage',$destinationemail,false);
// customisation
  if (strpos($html_message,'xmlns')) {
   $mail-> add_html($html_message);
// customisation
   } else {
  if (!empty($htmlmessage)) {
    $mail->add_html($htmlmessage,$textmessage,getConfig('systemmessagetemplate'));
    ## In the above phpMailer strips all tags, which removes the links which are wrapped in < and > by HTML2text
    ## so add it again
    $mail->add_text($textmessage);
  }
  $mail->add_text($textmessage);
}
banditsc
phpList newbie
 
Posts: 2
Joined: 5:47pm, Mon 14 Apr, 2014

Re: Allow HTML confirmation emails

Postby AlanGeorge » 8:35pm, Mon 14 Apr, 2014

The subscriber messages are self contained and do not use templates i.e.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" ><head>
<title>AlanGeorge - Please Confirm Newsletter Subscription</title>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#666666">
tables etc.
</body><html>


Personally the missing line breaks in the Admin Subscriber Messages do not present a problem though with multiple subscriber fields (attributes) your solution should make the system messages easier to read.
AlanGeorge
PL Geek
 
Posts: 97
Joined: 7:14pm, Tue 28 Feb, 2012


Return to Does phpList do this?

Who is online

Users browsing this forum: No registered users and 3 guests