Filters Actions and Hooks

In this chapter, we will build a module that will automate the process of sending a newsletter email to all of the users on our system. In Chapter 6, we looked at the email features. In this chapter, we will focus on three other important topics: building content filters, creating an action and assigning a trigger to the action, and creating a hook that other modules can implement.

Along the way, we will revisit some of the other topics we have already explored, but we will focus our attention on these three new topics. During the course of this chapter we will perform the following:

• Assign a dependency to a module

• Create a simple content type

Create content filter and an administrative interface for that filter

• Define a custom hook and implement it

• Revisit the mail API — this time to send a message to all users

• Use the theme system to theme plain-text email

• Create a trigger

This is a lot of ground to cover. But this chapter illustrates how complex module programming tasks can be accomplished efficiently in Drupal.

As usual, we will begin with a brief description of what we want this new module to do.

0 0

Post a comment