[mod] View HTML Email in Browser

3rd party code for phpList

Re: [mod] View HTML Email in Browser

Postby bhup18 » 8:29pm, Fri 25 Feb, 2011

Another Bug to report with 1.2.2

If you send a test message using PHPList's "Send a Test Message" function, and then later send this message to a live list..

The message does not get saved to the database, therefore an empty page will load for the user.


Thanks again for your hard work on this.
bhup18
phpLister
 
Posts: 11
Joined: 8:26pm, Wed 15 Dec, 2010

Re: [mod] View HTML Email in Browser

Postby locomot1f » 9:04pm, Fri 25 Feb, 2011

bhup18 wrote:Another Bug to report with 1.2.2

If you send a test message using PHPList's "Send a Test Message" function, and then later send this message to a live list..

The message does not get saved to the database, therefore an empty page will load for the user.


Thanks again for your hard work on this.



Is this in response to the problem i'm having?
Yes, this problem that I'm having is when trying to send a test message to myself. I actually don't know what will happen if I queue up a message. But I would think that it should work the same either way... correct?

I've tried creating the DB both ways, and I'm getting the same result.

xannonite, when you say "try deleting the table's primary key", do you mean remove the primary key element to that field? I've remove the primary key for both messageid and uniqid -> same problem.
Maybe it's just me... I would like to get this to work, but if no one else is having this problem, I may just have to accept it.

... Unless you have any suggestions...
locomot1f
phpLister
 
Posts: 7
Joined: 9:32pm, Thu 11 Mar, 2010

Re: [mod] View HTML Email in Browser

Postby xannonite » 9:50pm, Fri 25 Feb, 2011

locomot1f wrote:Is this in response to the problem i'm having?
Yes, this problem that I'm having is when trying to send a test message to myself. I actually don't know what will happen if I queue up a message. But I would think that it should work the same either way... correct?

I've tried creating the DB both ways, and I'm getting the same result.

xannonite, when you say "try deleting the table's primary key", do you mean remove the primary key element to that field? I've remove the primary key for both messageid and uniqid -> same problem.
Maybe it's just me... I would like to get this to work, but if no one else is having this problem, I may just have to accept it.

... Unless you have any suggestions...



Try sending a live message. Create a list with just you in it if you don't want to use an existing list. If it still doesn't work, I will do some testing on my machine and send you a pre-modded archive sometime this weekend.
xannonite
PL Nut
 
Posts: 36
Joined: 4:50pm, Tue 24 Feb, 2009

Re: [mod] View HTML Email in Browser

Postby Jappie » 8:26pm, Thu 14 Jul, 2011

Dear Xannonite, Locomot1f

I installed the 1.2.1 version of the online version mod and all seemed to work but... in my version the 'uniqid' is not appropriately populated either. I found your thread on this topic with an open and somewhat abrupt ending in February. Is this an issue of which you have come to understand what is at the basis of it? If so I'd definetely be very interested in hearing what I could do to solve the problem (I have followed all the suggestions offerered in this thread to no avail).

Your feedback, comments, tips and suggestions are much appreciated.

Best Jappie
Jappie
phpLister
 
Posts: 14
Joined: 8:20pm, Thu 14 Jul, 2011

Re: [mod] View HTML Email in Browser

Postby xannonite » 10:07pm, Thu 14 Jul, 2011

Jappie wrote:Dear Xannonite, Locomot1f

I installed the 1.2.1 version of the online version mod and all seemed to work but... in my version the 'uniqid' is not appropriately populated either. I found your thread on this topic with an open and somewhat abrupt ending in February. Is this an issue of which you have come to understand what is at the basis of it? If so I'd definetely be very interested in hearing what I could do to solve the problem (I have followed all the suggestions offerered in this thread to no avail).

Your feedback, comments, tips and suggestions are much appreciated.

Best Jappie


I never heard back from locomot1f after I sent the pre-modded archive. I will send the archive to you as well, and maybe you can tell me.
xannonite
PL Nut
 
Posts: 36
Joined: 4:50pm, Tue 24 Feb, 2009

Re: [mod] View HTML Email in Browser

Postby aquinn310 » 12:40am, Thu 27 Oct, 2011

in order to get this working with the current version (version 2.10.14) i had to make sure that the $hash variable was passing the value correctly. it didnt seem to be.

so in sendemaillib.php i added a couple of lines.

#
#-----[ FIND ]------------------------------------------
#
$htmlmessage = eregi_replace("\[USERTRACK\]",'',$htmlmessage);

#
#-----[ AFTER, ADD ]------------------------------------
#
$htmlmessage = preg_replace("/\[VIEWMESSAGEURL\]/i",$GLOBALS['scheme'].'://'.$website.$GLOBALS["pageroot"].'/vm.php?m='.$messageid.'&u='.$hash,$htmlmessage,1);
$htmlmessage = eregi_replace("\[VIEWMESSAGEURL\]",'',$htmlmessage);
$hash2 = $hash;

#
#-----[ FIND ]------------------------------------------
#
return 1;

#
#-----[ REPLACE WITH ]----------------------------------
#
if(preg_match('/(<html>)|(<head[^>]*>)|(<body[^>]*>)/i', $mail->Body)) {
Sql_Query(sprintf('update %s set data = "%s" where messageid = %d and uniqid = "%s"',
$GLOBALS["tables"]["messageview"],addslashes($htmlmessage),$messageid,$hash2));
if(!Sql_Affected_Rows())vise
Sql_Query(sprintf('insert into %s (messageid,uniqid,data) values(%d,"%s","%s")',
$GLOBALS["tables"]["messageview"],$messageid,$hash2,addslashes($htmlmessage)));exit

}
return 1;

#
#-----[ SAVE/CLOSE ALL FILES ]--------------------------
#

this got the mod working for me. lots of dirty dirty hacks here.
aquinn310
phpList newbie
 
Posts: 1
Joined: 12:34am, Thu 27 Oct, 2011

Re: [mod] View HTML Email in Browser

Postby xannonite » 4:03am, Thu 27 Oct, 2011

@aquinn310:

Can you output the value of $hash when you are having problems? I've looked through sendmaillib.php, and there is only one place where $hash is being modified. In versions 2.10.7 and later, $hash is being set to 'forwarded' before the script reaches the section containing 'return 1'. Just do a search for '#0011996' to find the line. I'm not sure if this is by design or if they meant to do a comparison there, but theoretically the assignment should not happen if FORWARD_PERSONAL_NOTE_SIZE is zero. Regardless, I am curious as to why you would need to store the hash in a separate variable if it is not being modified.

On a side note, looking into this issue has made me realize that I need to check to see if the value of $hash is 'forwarded' in any case. As such, I've updated the mod to version 1.2.3.
xannonite
PL Nut
 
Posts: 36
Joined: 4:50pm, Tue 24 Feb, 2009

Re: [mod] View HTML Email in Browser

Postby appa » 10:56am, Sat 05 Nov, 2011

hello

Thanks for your hard work, this is a great mod.

My question is the images which uploaded with template cannot be displayed when I click the view in browser. I checked the source, the path is just "xxx.jpg", without a full path to make it display.

Any suggestion on this?

thanks.
appa
phpLister
 
Posts: 6
Joined: 10:41am, Sat 05 Nov, 2011

Re: [mod] View HTML Email in Browser

Postby xannonite » 5:48pm, Sun 06 Nov, 2011

appa wrote:My question is the images which uploaded with template cannot be displayed when I click the view in browser. I checked the source, the path is just "xxx.jpg", without a full path to make it display.


Make sure you use a full URI for each image. Store the images somewhere on your website (e.g. http://yourwebsite.com/images). In the HTML for your template, use this code:

Code: Select all
<image src="http://yourwebsite.com/images/xxx.jpg" alt="xxx" />
xannonite
PL Nut
 
Posts: 36
Joined: 4:50pm, Tue 24 Feb, 2009

Re: [mod] View HTML Email in Browser

Postby barrancoguillaume » 1:52pm, Thu 02 Feb, 2012

Hi all,
I modify a bit the vm.php to delete the link on the online view.

I added just before the print $messagedata[0] these 2 lines :
Code: Select all
$messagedata[0] =   str_replace("\n", "", $messagedata[0]);
      $messagedata[0] =   preg_replace('/<div id=\"onlinemail\".*?div>/', '', $messagedata[0]);
barrancoguillaume
phpLister
 
Posts: 6
Joined: 1:16pm, Wed 01 Feb, 2012

Re: [mod] View HTML Email in Browser

Postby Jappie » 3:20pm, Thu 02 Feb, 2012

Hello Guillaume,

That's a great approach :lol: and I've succesfully added this to my vm.php mod. Much appreciated that you thought to share, I think that now I have a complete solution to my online needs incl. the RSS flux (which was a problem with the view_online.php modification).

Cheers Jan-Paul
Jappie
phpLister
 
Posts: 14
Joined: 8:20pm, Thu 14 Jul, 2011

Re: [mod] View HTML Email in Browser

Postby maniktushar » 10:22am, Mon 06 Feb, 2012

For people facing problems with uniqid not updatin g in the database table and a blank page coming on clicking on the link. Make the following modification in

sendemaillib.php

Find
Code: Select all
  if (FORWARD_PERSONAL_NOTE_SIZE && $hash = 'forwarded' && !empty($forwardedby['personalNote']) )



Replace with
Code: Select all
  if (FORWARD_PERSONAL_NOTE_SIZE && $hash == 'forwarded' && !empty($forwardedby['personalNote']) )


This should solve the problem.
maniktushar
phpList newbie
 
Posts: 1
Joined: 10:19am, Mon 06 Feb, 2012

Re: [mod] View HTML Email in Browser

Postby guiabase » 10:24am, Fri 09 Mar, 2012

Hello,

First to say this is really a great mod.
I installed phplist to use with smtp, this way (config.php):

# If you want to use the PHPMailer class from phpmailer.sourceforge.net, set the following
# to 1. If you tend to send out html emails, it is recommended to do so.
define("PHPMAILER",0); # because if I use 1 (the default value) forward message isn't working

# To use a SMTP please give your server hostname here, leave it blank to use the standard
# PHP mail() command.
define("PHPMAILERHOST",'mail.my_SMTP_Server.com');

# if you want to use smtp authentication when sending the email uncomment the following
# two lines and set the username and password to be the correct ones
$phpmailer_smtpuser = 'user@my_domain.com';
$phpmailer_smtppassword = 'my_password';

Using [mod] View HTML Email in Browser doesn't work this way.
It doesn't save messageid, uniqid, data to the the database table.

I believe some changes are needed, but can't figure out what and where.

I'm grateful to any help you can provide.

Thank you.
guiabase
phpList newbie
 
Posts: 2
Joined: 10:48am, Mon 24 Oct, 2011

Re: [mod] View HTML Email in Browser

Postby appa » 11:31am, Fri 09 Mar, 2012

Hi,

I'm having another problem.

The link cannot be shown on the text message, it just shows as below,

If you are having trouble viewing this email, please follow this link<>


So the users whom check the message in text format cannot view the online version. I put everything on the picture, they cannot get the content which I want them to see, then the mail is useless.

Can someone help?
appa
phpLister
 
Posts: 6
Joined: 10:41am, Sat 05 Nov, 2011

Re: [mod] View HTML Email in Browser

Postby Dragonrider » 1:41pm, Fri 09 Mar, 2012

appa wrote:Hi,

I'm having another problem.

The link cannot be shown on the text message, it just shows as below,

If you are having trouble viewing this email, please follow this link<>


So the users whom check the message in text format cannot view the online version. I put everything on the picture, they cannot get the content which I want them to see, then the mail is useless.

Can someone help?

That's the drawback of the TEXT email option, you don't get HTML sent. This is why you have the two versions sent when sending a test message, you get an HTML version as well as a TEXT version so you can see before sending for real, what your subscribers will see.

I think that there is a setting in the config/config.php file that allows you to edit the Text version manually so you would have to remove any <img src= or <a href= coding and put the links in openly in the Text version
My sites:- http://wharfedalefestival.co.uk, http://ilkleygardeners.org.uk, http://emergencyaid.net, http://dragonrider.co.uk
Latest phpList version is now 3.0.12 (3 February 2015) and requires a minimum of MySQL 5.0 and PHP 5.3.x
Dragonrider
Moderator
 
Posts: 3460
Joined: 6:58am, Sun 02 Jul, 2006
Location: Ilkley, West Yorkshire, United Kingdom

PreviousNext

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

Who is online

Users browsing this forum: No registered users and 2 guests

cron