phplist

NOTE:: Before reporting an issue, make sure you are running the latest version, currently 3.3.1


View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0015553phplist applicationMessage Managementpublic22-10-10 05:0716-10-14 12:28
Reporterh2b2 
PrioritynormalSeverityfeatureReproducibilityN/A
StatusresolvedResolutionfixed 
PlatformOSOS Version
Product Version 
Target Versionplugin DevelopmentFixed in Versionplugin Development 
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:
http://forums.phplist.com/viewtopic.php?t=17183 [^]
http://forums.phplist.com/viewtopic.php?t=17284 [^]
http://forums.phplist.com/viewtopic.php?t=1501 [^]
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0051137)
h2b2 (manager)
14-11-10 11:51

Xannonite developed this mod: View HTML E-mail in Browser
http://forums.phplist.com/viewtopic.php?p=58496#p58496 [^]
(0051704)
solmar (reporter)
23-08-12 19:04

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:
http://forums.phplist.com/viewtopic.php?f=7&t=17284&p=92785#p92785 [^]

Code below:

1/5 - In config.php
[code]
## 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;
[/code]

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

[code]
include_once dirname(__FILE__).'/uniquecode.php';
[/code]

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

[code]
# 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").'
</div>'.$htmlmessage.'</body>';
       $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 [^](.
</div>'.$htmlmessage.'</body>';
        } else {
        $htmlmessage = '<body>'.$htmlmessage.'</body>';
        }
    }
[/code]

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

[code]
#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);
        fclose($statichandle);
        }
[/code]

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

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

?>
[/code]
(0051709)
michiel (manager)
26-08-12 17:43


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,
(0051828)
michiel (manager)
31-10-12 15:10


that's a great candidate for a plugin
(0054541)
duncanc (developer)
11-08-14 11:12

The View in Browser plugin provides this functionality.

http://resources.phplist.com/plugin/viewbrowser [^]
(0054544)
gingerling (administrator)
11-08-14 11:24

I sooo want this plugin! :)
(0055444)
michiel (manager)
16-10-14 12:28

provided by

https://resources.phplist.com/plugin/viewbrowser [^]


Copyright © 2000 - 2017 MantisBT Team
Powered by Mantis Bugtracker