A simple Invite module for Drupal 6
- brad's blog
- Login to post comments
The Problem
I received a request for a simple 'invite a friend' module yesterday for a Drupal 6.x installation. They had already installed the 'Invite' module but it wasn't meeting their needs. Too much functionality, registration requirements for the invitee, etc..
All they really wanted was a way for people to send the link to the website to one or more friends via email. No registration, no fancy tracking, just a simple invitation module.
The Search
In my initial search I looked a number of modules and what version of Drupal they supported (5.x and/or 6.x):
- Invite (5.x, 6.x) - currently installed
- Node Invite (5.x)
- Simple Invite (5.x)
- Temporary Invitation (5.x)
The only module that seemed to address the website needs was Simple Invite but it was for Drupal 5.x and was still labelled as being in development.
Simple Invite
Simple Invite provides a link to 'Invite a Friend'. This gives the user a simple form requesting an email address (or several email addresses separated by commas ... in case you want to let a few friends know), and a comment box so the user can add their own text to the email. When emails are sent out they use a template that includes the users name, the website name, and a link to the website. The email also includes any text the user types in. Very simple and very easy to use.
The Simple Invite adminstration page allows an admin to change the email template and email subject template (very powerful!), and to restrict the number of emails addresses a user can enter at once (e.g., 10,20, etc.).
What wasn't there were module-level permissions to control who could use the 'invite' functionality and a few more selections for how many addresses could be entered at once (10 seemed too high and it seemed a limit of 1 would also be useful).
Even though it was written for Drupal 5.x it seemed the only good candidate. I grabbed a copy of the module and had a look. It did indeed meet the website needs in terms of functionality, but it seemed to need a bit of a dusting off and cleaning up in terms of completing the functionality. And, of course, it was for the wrong version of Drupal.
At this point, the only thing left was to upgrade the Simple Invite module to Drupal 6 and add the enhancements (cleanup) that I thought would be useful.
Upgrading the Simple Invite module from Drupal 5.x to Drupal 6.x
Drupal 6 changed major parts of the API with the consequence that modules written for Drupal 5.x would not work on Drupal 6. So, any upgrade from Drupal 5.x to 6.x was going to take a bit of time.
The first thing I did was read up on those changes. The second was to make the upgrade. This actually went quite smoothly as the Simple Invite module is small and not too complicated. It did take the better part of an afternoon to work through the changes but each change went smoothly with only the occassional typo to mess me up.
The second thing I did was add the extra things I thought were necessary (permissions and additional address settings). Given the upgrade work, this also went smoothly although the permissions part took a few tries to get right.
The third thing I did was test a few times on a clean installation of the website (something I keep handy for testing offline). I'd install the module and send a few emails to ensure it worked 'out-of-the-box'. No problems!
Next Steps
I've archived the module for future use and installed it on the website. If it works well and appears problem free I'll see about adding the code changes to the Drupal repository so others can make use of the upgrade.


