View Issue Details

IDProjectCategoryView StatusLast Update
0015553phpList 3 applicationCampaign Managementpublic21-06-18 13:01
Reporterh2b2 Assigned To 
Status resolvedResolutionfixed 
Summary0015553: Generate a link to view an online version of a message
DescriptionFrequently requested in the forum is a feature that allows inserting a link in a message that will generate an online version of the message, something along the lines of "If you are having trouble viewing this email click here to view it online".
One might think of using a placeholder (e.g., [ONLINEVIEW] to insert the link, and include functionality to generate the HTML page for that particular message (including corresponding template) and particular user (including personalization).
Additional InformationRelated forums topics:



14-11-10 11:51

manager   ~0051137

Xannonite developed this mod: View HTML E-mail in Browser


23-08-12 18:04

reporter   ~0051704

Whoops, I wrote a lot here and upon send, Mantis replied get lost.
Starting from an user submitted code, I developed an "online version" feature which is easy and works in PHPlist 2.11.6.
More words here:

Code below:

1/5 - In config.php
## turn on option to create a link in each email to a static copy of the message in case users have a hard time viewing message
$generate_static = 1;

2/5 - In sendemaillib.php, right at the beginning, after the call to accesscheck.php

include_once dirname(__FILE__).'/uniquecode.php';

3/5 - Also in sendemaillib.php,
Edit between rows...
"# some readers fail when it doesn't"
"$htmlmessage = '<body>'.$htmlmessage.'</body>';"
Replace "[web path to file directory]" with the real value.

# some readers fail when it doesn't
  if (!preg_match("#<body.*</body>#ims",$htmlmessage)) {
    if ($GLOBALS["generate_static"] == 1){
        $uniquecode = $_SESSION['uniquecode'];
        $htmlmessagestatic = '<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /><title>'.$messageid["subject"].'</title><body><div align="center" style="color:#003366; font-family: Arial, Helvetica, sans-serif; font-size: 12px; font-weight: bold;">Newsletter sent on '.date("j-m-Y").'
       $htmlmessage = '<body><div style="TEXT-ALIGN: center; PADDING-BOTTOM: 0px; LINE-HEIGHT: 22px; MARGIN: 0px 0px 12px; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; FONT-FAMILY: Arial, sans-serif; COLOR: #666666; FONT-SIZE: 12px; PADDING-TOP: 0px" align="center">If you cannot see the message, http://www.'.getConfig(.
        } else {
        $htmlmessage = '<body>'.$htmlmessage.'</body>';

4/5 - Also in sendemaillib.php, immediately after the above.
Replace "[absolute path to file directory]" with real value.

#write to static file here
    if ($GLOBALS["generate_static"] == 1){
        $static = '[absolute path to file directory]/'.$uniquecode.'.html';
        $statichandle = fopen($static, 'w');
        fwrite($statichandle, $htmlmessagestatic);

5/5 - Create a uniquecode.php file in the /admin directory with the following content:

        $alphanum = 'abcdefghijklmnopqrstuvwxyz1234567890';
        $inc = 1;
            while ($inc < 5){
                $alphanum = $alphanum.'abcdefghijklmnopqrstuvwxyz1234567890';
        $uniquecode = substr(str_shuffle($alphanum), 0, 10); // 10 is the amount of letters/numbers selected by variable alphanum';
        $_SESSION['uniquecode'] = $uniquecode;



26-08-12 16:43

administrator   ~0051709

that's great, thanks. Yes, mantis mangles html and code in the comment fields. It might be good to attach a text file, but I guess the forum posts will help as well.

I'll try to find time to add this,


31-10-12 15:10

administrator   ~0051828

that's a great candidate for a plugin


11-08-14 10:12

updater   ~0054541

The View in Browser plugin provides this functionality.


11-08-14 10:24

manager   ~0054544

I sooo want this plugin! :)


16-10-14 11:28

administrator   ~0055444

provided by