Skip to content

Talkpoppycock/phplist-plugin-viewbrowser

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

61 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

View in Browser Plugin

Description

The plugin generates a page that displays a campaign email customised with subscriber and phplist placeholders, and link tracking. A placeholder, [VIEWBROWSER], is included in a campaign and is replaced by a link to the page when the email is created by phplist. Alternatively the placeholder [VIEWBROWSERURL] can be used for the URL of the page.

The plugin can also generate an anonymous page, where subscriber placeholders are removed.

Installation

Dependencies

Requires php version 5.3 or later.

This plugin requires the Common Plugin v3.0.2 or later to also be installed, and will not work without that. You must install that plugin or upgrade to the latest version if it is already installed. See https://github.com/bramley/phplist-plugin-common

Requires the XSL extension to be included in php. You can verify this through phpinfo.

Set the plugin directory

The default plugin directory is plugins within the phplist admin directory but you can use a directory outside of the web root by changing the definition of PLUGIN_ROOTDIR in config.php. The benefit of this is that plugins will not be affected when you upgrade phplist.

Install through phplist

Install on the Plugins page (menu Config > Manage Plugins) using the package URL https://github.com/bramley/phplist-plugin-viewbrowser/archive/master.zip.

In phplist releases 3.0.5 and earlier there is a bug that can cause a plugin to be incompletely installed on some configurations (https://mantis.phplist.com/view.php?id=16865). Check that these files are in the plugin directory. If not then you will need to install manually. The bug has been fixed in release 3.0.6.

  • the file ViewBrowserPlugin.php
  • the directory ViewBrowserPlugin

Then click the button to enable the plugin.

Install manually

Download the plugin zip file from https://github.com/bramley/phplist-plugin-viewbrowser/archive/master.zip

Expand the zip file, then copy the contents of the plugins directory to your phplist plugins directory. This should contain

  • the file ViewBrowserPlugin.php
  • the directory ViewBrowserPlugin

Then click the button to enable the plugin.

Install view.php (phplist 3.0.6 and earlier)

This step is necessary only for phplist releases 3.0.6 and earlier.

Copy the file view_3.0.6.php from the ViewBrowserPlugin directory to the phplist directory - this is usually /lists, and rename to view.php.

Amend .htaccess in the phplist directory to allow the file to be accessed. Change this line

<FilesMatch "(index.php|dl.php|ut.php|lt.php|download.php|connector.php)$">

to

<FilesMatch "(index.php|dl.php|ut.php|lt.php|download.php|connector.php|view.php)$">

Configuration

On the Settings page you can specify the link text, such as "View this email in your browser".

You can change the styling of the link by specifying additional attributes for the <a> element, such as a specific class or a custom style. For example

class="myclass"

or

style="color: #ea5b0c;"

You can also specify whether the plugin should generate anonymous pages. The default value for this is no.

The settings includes a set of plugins that, if installed, will be called when generating the email. See the section "Integration with other plugins".

Usage

Placeholders

Include the placeholder [VIEWBROWSER] in a message or template. When phplist generates the emails for the campaign, the placeholder will be replaced by a link (an HTML <a> element) to the view page. The link URL includes the message id and the subscriber's uid.

When a subscriber clicks the link the plugin generates the email as a web page using the message, the template (if used), and by replacing placeholders.

Alternatively you can use the [VIEWBROWSERURL] placeholder. This is replaced by the same URL that is used for the [VIEWBROWSER] link.

Suppress the viewbrowser link

When the plugin generates the email as a web page the result will include the link generated by the [VIEWBROWSER] placeholder. If you do not want that to appear in the online version of the email then you can suppress it by wrapping the link and any surrounding text in an element with a class of "viewbrowser".

For example, if your campaign message includes

<p>If this email isn't displaying correctly [viewbrowser]</p>

then either wrap that within a div element

<div class="viewbrowser">
<p>If this email isn't displaying correctly [viewbrowser]</p>
</div>

or add the class to the p element

<p class="viewbrowser">If this email isn't displaying correctly [viewbrowser]</p>

The plugin will then remove the complete element that has the "viewbrowser" class when it generates the email as a web page.

Anonymous pages

You can use a link to an anonymous page, which has the subscriber placeholders removed, by using a URL of this format but customised for the actual location of phplist and the campaign id

http://www.mysite.com/lists/?m=36&p=view&pi=ViewBrowserPlugin

This URL can be used outside of phplist and will allow anyone to view the campaign email.

Integration with other plugins

This plugin allows other plugins to transform the email as it is being generated by, for example, replacing some custom placeholders. To do that, the other plugin needs to be listed in the setting "Plugins to be used when creating the email" within the View in Browser group on the Settings page.

In most cases the default list should not be changed, but another plugin can be added to the set when you know that it is compatible. The recommended way is to raise a topic in the phplist support forum https://discuss.phplist.org/.

##Support##

Please raise any questions or problems in the user forum https://discuss.phplist.org/.

Donation

This plugin is free but if you install and find it useful then a donation to support further development is greatly appreciated.

Donate

Version history

version     Description
2.4.1+20151121  Update dependencies
2.4.0+20151119  Integration with other plugins
2.3.0+20151106  Suppress VIEWBROWSER link
                Minor bug fixes
2.2.0+20151018  Internal changes to use namespaced classes
2.1.3+20150916  Display [CONTENT] when used by Content Areas plugin
2.1.2+20150907  Fix problem introduced with previous change
2.1.1+20150906  Fix problem where default settings are not used
2.1.0+20150819  Display attachments with download links
2.0.1+20150817  Fix backslashes being displayed
2.0.0+20150815  Updated dependencies
2015-07-29      Allow additional attributes on the link <a> element
2015-06-25      Internal changes
2015-03-23      Change to autoload approach
2015-02-06      Use & as arg separator for http_build_query()
2014-11-18      Allow text to be translated
2014-10-14      Provide anonymous page, support sending campaign from a webpage
2014-10-02      Keep the original document type
2014-09-18      Handle embedded template images, allow other plugins to transform the email
2014-08-16      The view page is now a plugin public page for phplist 3.0.7
2014-08-09      Test for xsl extension being installed
2014-05-05      Added fromemail placeholder
2014-04-17      An email is now always personalised
2014-04-14      Support for click tracking and further placeholders
2014-04-12      Support for user tracking
2014-04-09      Added to GitHub

About

Plugin for phplist 3.x to view an email in a browser

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 100.0%