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
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: [^] [^] [^]
TagsNo tags attached.
Attached Files

- Relationships

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

Xannonite developed this mod: View HTML E-mail in Browser [^]
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: [^]

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;

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

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

The View in Browser plugin provides this functionality. [^]
gingerling (administrator)
11-08-14 11:24

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

provided by [^]

Copyright © 2000 - 2017 MantisBT Team
Powered by Mantis Bugtracker