Auto-generating messages from RSS feeds

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:

  • Your PHP installation must have XML support. If you don't have this, or don't know, ask your web hosting provider.
  • Your RSS feed must be accessible (via HTTP) to your phpList installation.
  • Your PHP instance should be running with 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 must have enabled phpList's repeating messages feature.

    Note

    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.

Enabling RSS support

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):

Enabling RSS supportmessagesauto-generating, from RSS feeds

Associating an RSS feed with a list

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:

Associating an RSS feed with a list

Tip

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:

Associating an RSS feed with a list

However, you'll notice that if you click on (view items), there will be no items displayed:

Associating an RSS feed with a list

This is because, like the message queue, each RSS feed must be periodically "processed" for new items, before phpList will know about them.

"Getting" new RSS items

To "get" new RSS items, click on the new getrss link at the bottom of the main admin page:

"Getting" new RSS items

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.

"Getting" new RSS items

User requirements to receive RSS messages

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:

User requirements to receive RSS messages

Note

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).

Sending a message including RSS

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:

Sending a message including RSS

Setting your RSS message's schedule

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.

Setting your RSS message's schedule

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:

Setting your RSS message's schedule
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.138.69.163