If this email isn't displaying correctly [viewbrowser]
then either wrap that within a ''div'' element
If this email isn't displaying correctly [viewbrowser]
or add the class to the ''p'' element
If this email isn't displaying correctly [viewbrowser]
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 enabling the anonymous page on the Settings page and 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.
By default, only campaigns sent to public lists can be viewed in this way. An attempt to view a campaign that was sent to a private list is rejected. You can change this behaviour by specifying IDs of allowed lists on the Settings page.
==== Open links in a new window/tab ====
When this setting is enabled, the plugin will add a ''target'' attribute to each '''' element that does not already have such an attribute so that the link is opened in a new browser tab or window
target="_blank"
===== Archive page placeholders =====
Include the placeholder [ARCHIVE] in a message or template. When phpList generates the emails for the campaign the placeholder will be replaced by a link to a Campaign Archive page, which lists the campaigns sent to the particular subscriber.
The subject field of each listed campaign is a link to view the campaign in a new browser window.
Alternatively, you can use the [ARCHIVEURL] placeholder. This is replaced by the same URL that is used for the [ARCHIVE] link.
{{:plugin:viewbrowser3.png?nolink&600|}}
==== Anonymous archive page ====
You can display an archive page of campaigns sent to a specific list using a URL of this format, where xxx is the list id
https://mysite.com/lists/?p=archive&pi=ViewBrowserPlugin&list=xxx
Each campaign will be displayed anonymously with subscriber placeholders removed. The URL can be used outside of phpList to allow anyone to see the campaigns sent to that list.
By default, only public lists can be viewed in this way. An attempt to display an archive for a private list is rejected. You can change this behaviour by specifying IDs of allowed lists on the Settings page.
On the Settings page, the setting to provide an anonymous page must be enabled.
==== Admin archive page ====
The plugin also provides an archive page showing campaigns sent to the current admin. This is accessed through the menu Campaigns > Campaign Archive.
{{:plugin:viewbrowser4.png?nolink&600|}}
==== Styling ====
The CSS styling of the public campaign archive page can be customised by modifying the default styling. The recommended way is to make a copy of the archive.css file with your changes, then enter the URL to that file on the Settings page.
====== Log HTML parse errors ======
The plugin uses the php DOM parser which is more strict in accepting valid HTML than a web browser. This means that the if the template and message are not valid HTML then the plugin might not display the email as expected. If you find problems with having the plugin display the campaign as expected then you can see if there were any problems parsing the HTML.
Copy/paste this to the end of the config.php file
$log_options = [
'threshold' => 'DEBUG',
'classes' => [
'phpList\plugin\ViewBrowserPlugin\ContentDocument' => true,
]
];
The plugin will then log any parse errors to a file in the directory identified by the ''$tmpdir'' variable in config.php, named for the current date, e.g. log_2023-06-30.txt.
To disable the error logging change ''DEBUG'' to ''OFF''.
====== 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/.