Drupal 7: Rules Module

Drupal is a great CMS for anyone wanting to develop a site quickly, what makes this especially easy is the fact that Drupal operates on a module system, each module is responsible for adding a piece of functionality to your site which is independent of the Drupal core.

One module that we have been using recently is the ‘Rules Module’ – this module allows the developer to create a set of rules, with optional conditions and specified actions.

As an example, we recently needed Drupal to send an e-mail when a node of a certain type was saved, the first part was to setup the ‘Event’ which was literally just a case of selecting from a drop down menu:

 

 

 

After this we then needed to setup some conditions so that the event would only apply to the saving of a certain type of node.

 

 

 

 

At this point the rule is setup, any time we save a node of type “File Upload” our action will be triggered, actions can do many things like publish content, remove content, and remove users, one other option is to send an e-mail, which can be setup with a relatively simple interface.
Each part of the action interface is just a text-area to provide the to-address, subject, message, and from-address – these elements can be static pieces of information or you can use the “data selector” to get various pieces of information that we can fetch from our website and send in an e-mail.


As an example, we are able to set the to-address as the e-mail address which is stored on the current node we are viewing, or maybe we want to set the from-address to the e-mail address of the user who is currently logged in.

Rules module can do much more and is a great module, you can find this module at the URL here.

This entry was posted in Managed Hosting. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>