One of phpList's unique strengths is its ability to process RSS feeds and insert them into your messages. For example, you may distribute a formal daily newsletter, but include your latest twitter posts at the bottom.
There are some requirements to processing RSS feeds with phpList:
safe_mode
off. Some web hosting providers will enable safe_mode
for security reasons—unfortunately, this can block the RSS-fetching operation of phpList.You can test whether your PHP includes XML support and determine the status of safe_mode
by creating a file called test.php
, which contains only the following line:
<?php phpinfo(); ?>
Then upload this file to your hosting provider and open its public URL in your web browser. PHP will give you detailed information about your installation.
To enable RSS support, look for the following line in config/config.php:
define("ENABLE_RSS",0);
Change ENABLE_RSS
from 0
to 1
to enable RSS support.
If you have successfully enabled RSS support, you will see three new RSS-related functions on the main admin page (getrss, viewrss, and purgerss):
phpList allows you to associate a single RSS feed with a single list. To add a feed to a list, edit the list, and add the RSS feed URL to the RSS Source input field:
Validating a feed
You can confirm that the RSS feed URL is valid by running it through the "validator" at http://validator.w3.org/feed/.
When you view the summary of your lists, you'll now see the RSS feed associated with each list:
However, you'll notice that if you click on (view items), there will be no items displayed:
This is because, like the message queue, each RSS feed must be periodically "processed" for new items, before phpList will know about them.
To "get" new RSS items, click on the new getrss link at the bottom of the main admin page:
phpList will now connect to the URL and use the built-in XML libraries to process the RSS feed and put each item into the database. This getrss action is the acid test of your RSS implementation—if this doesn't work, then address the requirements with your web hosting provider or test your RSS feed for validity, before proceeding with sending an actual message.
Because RSS messages are designed to take advantage of the "repeating messages" function of phpList, in order for users to receive these messages, they must have already selected an RSS frequency of either hourly, daily, or weekly.
You can confirm a user's RSS frequency setting by examining their user account:
If you plan to make use of repeating RSS messages, make sure that your subscribe form includes the option to select a frequency. If you want to force any new subscribers into a particular frequency (that is, they are deliberately subscribing for RSS updates), you can simply restrict the RSS frequency options to a single option (such as daily).
Now that you have a working RSS feed, it's time to send a message that will include the items in this feed. As usual, use the send a message link to compose a new message to the appropriate list.
Ensure you enter the placeholder [RSS] somewhere in your message:
If you simply send a message containing [RSS] as a standard, one-off message, the RSS feed will not be inserted into the message. For a message to include RSS items, phpList needs to know whether this message is destined for users who've selected an hourly, daily, or weekly RSS frequency.
On the Scheduling tab, select your RSS frequency. Note that when you click on the Save button, the Repeat message every drop-down box will automatically be adjusted to match your RSS frequency selection. That is, repeating messages is a pre-requisite of RSS support.
Once you've saved the message, the next time the queue is processed, any new RSS items will be included in the message to each user:
3.135.196.172