Development Seed Blog

A More Flexible Letter to the Editor

New Letter to the Editor moduleA letter to the editor feature is essentially an extended petition where you collect names and messages, but instead of just storing them, you also send them off to the email address of whatever paper the user chooses. From a functionality standpoint the only semi-difficult part is handling the email addresses of newspapers, the rest of the functionality exists all over.

We had originally deployed an LTE module for Planned Parenthood, which provided a single site-wide letter, and was heavily based off of the LTE developed by Downhill Battle. But what we really needed was the ability to deploy multiple LTE campaigns for a single site, basically it an LTE-type node.

What we came up with is a really heavily modified version of Citizenspeak, an existing Drupal module by George Holsting.

The Citizenspeak module was used as a starting point because it provides multiple email campaigns for a single site. So all I had to do was strip out the Citizenspeak node's relationship to a user, and add in functionality to let a node handle user selectable recipients, or pull from a newspaper database.

Planed Parenthood, who we are deploying this new module for, uses a Vocus newspaper database It was critical to ensure that this new LTE could leverage all the email addresses in the Vocus databas. At the same time I wanted leave the door open for more focused campaigns which would have a shorter list of recipients, that could be entered by a site administrator, like where we deployed this for votenopowergrab.com/letter.

As you can see we are really trying to focus on flexibility. The module that Citizenspeak eventually became, which we've been calling seedcampaign, creates a new node type that can function like a petition, a LTE, or a database driven LTE.

Usability was also a major focus in our development of this module. We wanted site admins with out coding skills to be able to quickly update or create new letter campaigns or petitions on their own. Having recently started using the tabs module we really wanted to use it in this module to present different sets of information to help in the letter writing process, ie a tab for talking points, on for helpful hints, and one for background information. When viewing a seedcampaign the screen is broken into quadrants, on the top left the list of papers, on the top right is the form users contact information, on the bottom left is a big text area for the letter, and in the bottom right is the tabbed talking points, hints, and background info.

Also, campaigns sometimes need some kind of a ‘Dean Bat’, a visual measure of how close the goal is. So we added that to this module too, admins can set the campaign's goal, the bat's upper and lower limit, and even add some fluff, to bolster the numbers. This was influenced by the echo_bat module built by echoditto. http://opensource.echoditto.com/

Attached is tarball of the module for drupal 4.6 in it's current state. We haven't yet given it the full QA rundown, and there are still a few things I'd like to fix up, including alot of code that is left over from the modules previous life as Citizenspeak. But we wanted to get it back out to everyone as soon as possible. Here it is, enjoy / use at your own risk/ and always backup your database before installing a new module.

I hope after some good feedback from George Holsting and the guys at CivicActions we will have a better idea of how to commit some of this functionality back into drupal.org

Comments
You're doing great Jeff.

You're doing great Jeff.

looks great - 4.7?

I'm super excited about this module, and we'll definitely be figuring out how to integrate it in the near future. Are there plans to 4.7ize it?

Thanks

Thank you for working on this module.

Because I'm all about repeating myself

This is an ideal example of a send sub-module.

Thank you for working on

Thank you for working on this module. It's sounds very promising. One question: where can I download the tabs module? I could not find it in Drupal nor CivicSpace websites.

Thanks for any leads.

Hi Jose, thanks for your

Hi Jose, thanks for your interest. Nedjo made the tabs modules and has this in his sandbox.

cheers,
Ian

Thanks! I went to Nedjo's

Thanks! I went to Nedjo's sandbox and uploaded the module - the tabs look great. Now the one problem I'm having is that emails to newspapers are not being sent. I was wodering if you'd come across this problem. And if not, can I contract you to fix this on my site? I'm sure I'm missing something very odvious. Let me know. Thanks.

It looks like I left a line

It looks like I left a line or two of testing code in the version of the module that I uploaded. To fix the problem you need to edit two lines in seedcampaign.module. Comment-out line 244 and un-comment out the one below it, line 245.

That should fix you the problem, also be sure to have the premissions set.

If that doesn't work let me know and I'll get you a patched version of the module.

-jeff

thanks to Sheldon Rampton

I just wanted to add a thanks to Sheldon Rampton over at the Center for Media and Democracy for his initial code which was a port of the Downhill Battle application to a Drupal module.

Papers database?

Thought I'd install it, and got as far as the query on the {papers} database. But that's not in the distribution. ???

Right, this is an

Right – this is an issue.  Since news paper databases are a little
pricey and they are sold just to one organization with restrictions on who can
use them we could not include an updated database with this module. For the
national campaigns we have been using a Vocus database.  This is not a good option for most people
simply because it is wicked expensive. 
We are in talks with some other organizations about lower costs alternatives.  The trick here is that a newspaper database
will always cost money because they need to be kept up-to-date.  That said a simple LTE database does not
change that much since the addresses are like editor@ info@ and so forth – very
generic.