larger smaller normal text version of this page
phplist Documentation

RSS Functions

What is RSS? What can phplist do with RSS?

For a definition of RSS, see: Wikipedia.
RSS feeds can be useful to send automatic messages which include items retrieved from a third-party source (a forum, a CMS, a blog, etc.) to users subscribed to a list you own.

Example: you have created a list entitled 'latest news from our forums' which users can subscribe to. You attach an RSS Source which will feed your phplist system with the latest items published in your forums. You can then send to the users on the list 'latest news from our forums' the latest items in your forums... automatically! phpList will insert the items in the message and send them to your users. You don't have to copy/paste anything.

Enabling RSS

For RSS to work you should enable the RSS feature in your config.php file. Keep in mind that XML support in your PHP installation is required for this feature.

# phpList can send RSS feeds to users. Feeds can be sent daily, weekly or
# monthly. To use the feature you need XML support in your PHP installation, and you
# need to set this constant to 1

# if you have set up a cron to download the RSS entries, you can set this to be 0

Setting up an RSS source in phpList

  1. General configuration for RSS feeds are system-wide (they affect all RSS feeds and lists in the same way), and can be found in phplist Configuration. The configuration determines what elements from an RSS source are used (title, date, description, etc.), and in what order they are displayed (do you first put the title? the date? do you insert line breaks? etc.) in messages sent out by phpList. Example:
    Title of the latest post on our forums: [title]<br>
    For more, visit the URL: [link]
  2. An RSS feed is necessarily tied to a list. To use an RSS feed, you must tie an RSS Source to a list. See lists to learn where you must add the RSS Source to a list. Each list can have only one RSS Source, but various lists can have the same RSS source.
  3. Once you have tied a list to an RSS Source, you can import RSS items. This will fetch the latest items from your RSS source.
  4. You can view RSS items at any time. Depending on the way you proceed, you either view all the items from all the RSS sources, or you view items from one source only.

Including RSS items in a message

To include RSS items in a message, you must include the [RSS] placeholder somewhere in the text of your message. When the message is sent out to a list, the RSS items tied to that list's RSS source will be inserted instead of the [RSS] placeholder.
This placeholder will be replaced by RSS items in a format and with the content specified in your system's configuration (see: Template for text/HTML item in RSS feeds).

To create a template to send RSS feeds automatically, you must use the scheduling tab. The message, once sent this way, will be permanently put in the message queue and will be sent to users when specified by the admin (daily, weekly, monthly, etc.) when you process the queue. As with all messages, users will not receive twice the same message: only users newly subscribed to the list will receive the message again, or the other users will receive the same message again if and when there are new items in the feed.

Additional information

  • phpList does not include the RSS items when you send a test message.
  • It is possible to automate the Get RSS function by adding a cron job.
  • If you enable RSS for an existing installation keep in mind:
    • A RSS list needs a schedule to be recognized as a RSS list
    • All users need their 'RSS Frequency' to be set to the same frequency using the word daily, weekly or monthly
    • A different message must exist for every schedule



(Note: Prior to this checklist, your users MUST have their RSS Frequency set to daily, weekly or whatever.)
1 - set the ENABLE_RSS to 1 in config.php
2 - add the RSS link to a list, and make that list active
3 - make sure the feed validates:
- do the "get RSS" function from main page
- can you "view RSS" from main page? make sure you can
4 - insert [RSS] in your message content and or template
5 - select a schedule for your message (this must match the RSS Frequency set per user. If you schedule the RSS message for daily distribution but your users have their RSS Frequency set to Weekly they will not receive the RSS.)

Note: again, make sure your list is active, and be aware that RSS does not appear if you send a 'test message'. Also this was tested with version 2.10.5 of phplist
  • In order to allow phpList to send out RSS you need to follow these steps:
  • Enable the RSS feature
  • Set ENABLE_RSS to 1 in your config.php file
  • phpList will now display additional functionality that allows you to set up RSS mailings.
  • The steps to add mailings are:
  • 1. add a RSS source to a list. Currently you can have one source per list.
  • 2. create a subscribe page that has RSS frequency selection set up for the users who subscribe. Current possible values for frequencies are "daily", "weekly" and "monthly".
  • 3. regularly run the page "Get RSS".
  • The get RSS page will find all data from the RSS feeds you have set up on your lists.
  • This data is cached (by Onyx RSS) and the cache file is written in your "tmpdir" directory as identified in your config file.
  • The cache will expire every 3 hours.
  • 4. Create a message that will be the template for your RSS messages, and identify the frequency for the message. You can send the message like a normal phpList message, and you need to add [RSS] to the content of the message to identify where the list of RSS items needs to go.
  • You can set up one message per frequency. If you have a previous message for the frequency you create, that one will be marked "sent" instead of "submitted".
  • If you run a multi admin system, the messages are unique for a frequency - admin combination
  • 5. Run your "processqueue" page as normal
  • What will happen:
  • When phpList encounters a message that is a template for RSS feeds, it will find the users who match the lists it exists for, and assemble the RSS items for the user. A message will be used only for users who have identified the same RSS-frequency as the message.
  • If there is something to send, the RSS items will be inserted in the [RSS] placeholder of the message, which will then be sent.
  • Notes:
  • 1. phpList uses a threshold for sending emails. If there are less than the threshold items to be send to the user, the message will not be sent. The threshold is set in your PHPlist configuration (not the config file)
  • 2. phpList uses templates for the items to be sent, one for text items and one for HTML items. You can change these in the phpList configuration.
  • use [title], [link] and [description] as the placeholders.
  • 3. The order of RSS items is by list and you can add separators between sets of items if you use [listname] as a placeholder in the separator it will be replaced by the listname for that set of RSS items, and only once per set of items (i.e. per list)"

Tips & Tricks from the forum

Related pages
Page was generated in 0.0968 seconds