meta data for this page
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
plugin:viewinbrowser [2023/06/30 19:34] – [Log HTML parse errors] duncanc | plugin:viewinbrowser [2024/06/22 20:31] (current) – duncanc | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== View in browser ====== | ||
+ | |||
+ | ---- plugin ---- | ||
+ | |||
+ | description: | ||
+ | author | ||
+ | type : | ||
+ | lastupdate : 2014-07-12 | ||
+ | compatible : phpList 3.0.x | ||
+ | depends | ||
+ | conflicts | ||
+ | similar | ||
+ | tags : | ||
+ | |||
+ | sourcerepo : https:// | ||
+ | |||
+ | |||
+ | |||
+ | The plugin provides a page that displays a campaign email in a browser. The page is accessed by including a placeholder, | ||
+ | |||
+ | It also provides an archive page that lists all emails sent to a subscriber. That page is accessed by including a placeholder, | ||
+ | |||
+ | |||
+ | ====== Installation ====== | ||
+ | |||
+ | See the README file on the GitHub page https:// | ||
+ | |||
+ | ===== Translations ===== | ||
+ | |||
+ | The text displayed by the plugin can be translated into other languages. See the file '' | ||
+ | |||
+ | To create a new language file, copy '' | ||
+ | |||
+ | You can share your new language file by submitting it for inclusion in the plugin. Please create a topic in the user forum or an issue on GitHub. | ||
+ | |||
+ | |||
+ | ====== Configuration ====== | ||
+ | |||
+ | The Settings page has a View in Browser group where you can configure the plugin. | ||
+ | |||
+ | * The text to be used in the view in browser link. | ||
+ | * The text to be used for the archive page link. | ||
+ | * Additional attributes to be used to style the links. | ||
+ | * Whether the plugin should provide an anonymous page. | ||
+ | * Restrict anonymous access to public lists or to specific lists. | ||
+ | * Plugins to be used when creating the web page. | ||
+ | * The number of items to display on each campaign archive page. | ||
+ | * URL to a custom CSS file to style the campaign archive page. | ||
+ | * Whether links should open in a new window/tab | ||
+ | |||
+ | {{: | ||
+ | |||
+ | |||
+ | ====== Usage ====== | ||
+ | |||
+ | |||
+ | |||
+ | ===== View in browser 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 ''< | ||
+ | |||
+ | 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, | ||
+ | |||
+ | <WRAP centre round tip 60%> | ||
+ | To use [VIEWBROWSERURL] in the link dialogue of CKEditor you need to select " | ||
+ | {{: | ||
+ | |||
+ | </ | ||
+ | |||
+ | You can also refer to a different campaign in these placeholders by using a placeholder of this format [VIEWBROWSER: | ||
+ | |||
+ | ==== Styling ==== | ||
+ | |||
+ | On the Settings page, you can specify the link text, such as "View this email in your browser" | ||
+ | |||
+ | class=" | ||
+ | or | ||
+ | |||
+ | style=" | ||
+ | |||
+ | ==== 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 " | ||
+ | |||
+ | For example, if your campaign message includes | ||
+ | |||
+ | <p>If this email isn't displaying correctly [viewbrowser]</ | ||
+ | |||
+ | then either wrap that within a '' | ||
+ | |||
+ | |||
+ | < | ||
+ | <div class=" | ||
+ | <p>If this email isn't displaying correctly [viewbrowser]</ | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | |||
+ | or add the class to the '' | ||
+ | |||
+ | |||
+ | < | ||
+ | <p class=" | ||
+ | </ | ||
+ | |||
+ | |||
+ | The plugin will then remove the complete element that has the " | ||
+ | |||
+ | ==== 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:// | ||
+ | |||
+ | 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 '' | ||
+ | |||
+ | < | ||
+ | ===== 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, | ||
+ | {{: | ||
+ | |||
+ | ==== 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:// | ||
+ | |||
+ | 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. | ||
+ | {{: | ||
+ | ==== 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 | ||
+ | |||
+ | <code php> | ||
+ | $log_options = [ | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ] | ||
+ | ]; | ||
+ | </ | ||
+ | |||
+ | The plugin will then log any parse errors to a file in the directory identified by the '' | ||
+ | To disable the error logging change '' | ||
+ | |||
+ | |||
+ | ====== 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 " | ||
+ | |||
+ | 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:// | ||
+ | |||
+ | ====== Support ====== | ||
+ | |||
+ | Please raise any questions or problems in the user forum https:// | ||
+ | |||