The Rules module is used to configure automated actions on your website, such as sending out e-mails, updating nodes or displaying messages to users. The actions could either be triggered by selected events on your site, or called by other tools and modules. One of the powers with Rules is the flexible ways of evaluating conditions before any actions are executed.

You could for example use Rules to:

  • assign all new users a selected role;
  • unpublish all comments flagged as spam by at least three users;
  • set entity field values based on complex conditions;
  • allow users to subscribe to comments on selected content;
  • send e-mail reminders to users who have not logged in for three weeks; or
  • schedule publishing, unpublishing and deletion of content.

When you become skilled in Rules configuration, you will be able to use Rules to replace quite a few small modules, both contributed to drupal.org and custom-written. This chapter only covers the basic configuration of Rules.

TIP: Combined with the RESTful Web Services module, Rules can be used to connect triggers and actions across different Drupal sites. These functions are still under development and are not discussed further in this book.

The initial version of this section of the Community Documentation came from the book Drupal 7: The Essentials, courtesy of NodeOne and Johan Falk.

Author's note: This chapter was written while Rules for Drupal 7 was still in very early stages. Though some parts of this chapter are still quite useful (imho), there are better places to learn Rules, such as: Rules' own online docs or the Tiny Book of Rules (pdf).