Tuesday, December 2, 2014 - 11:19
Written by

The ability to create petitions in CiviCRM was a tremendous move forward for people using CiviCRM for political organizing. The petitions feature took another step forward with the Petition Email extension, that allows copies of your petition to be automatically sent by email to a given target. However, the holy grail of e-advocacy was still just out of reach: automatically sending your petition to the petition signer's elected official.

Now, CiviCRM will have it.

The Progressive Technology Project is putting our final touches on a ground-up re-write of the Petition Email extension that will allow the target to be chosen dynamically based on the information provided by the petition signer. You can still specify one or more people to receive a copy of all petitions signed. However, with the re-write, you will also be able to specify a group of contacts that will get the petition if a defined set of fields match the petition signer.

The extension will not do the address to electoral district matching for you. To fully implement this feature, you will need another extension to handle the lookups (for example, we are using the Drupal CiviCRM Cicero module). Any third party module or extension that automatically updates each contact after it is saved with the right district information will work with Petition Email (and it seems that Google is making an API for this kind of lookups available for free if anyone is looking for a good extension project).

How does it work? 

First, setup your module or extension for doing address to district lookups (using, for example, the Drupal CiviCRM Cicero module). You will need to create custom fields to hold your election district information (e.g. state senate district id, city council district id, etc). Make sure that new contacts are getting properly coded to the right districts.

Next, create one or more target groups in your database. For example, you might import all of your state senators or your state assembly people or city council members. Be sure that these contacts are properly coded to their districts (using the same custom fields).

Then, create your petition. You will see an extra checkbox called "Send email to target." Clicking this checkbox shows a number of new fields which allow you to specify how the email messages should be sent.

The critical section allows you to specify a set of static targets and up to three dynamic target groups with matching fields. For example, if you are running a state-wide campaign, you might specify the Governor and Lieutenant Governor as static targets, since they represent everyone in the state and should get a copy of all petitions. You then could specify the state senator group as one target (which would be paired with the state senate district id) and the state assembly group as the second target (which would be paired with the state assembly district id).

When a petition signer puts in their address, their senate and assembly district ids would be looked up and recorded. Then, the Petition Email extension would find any contact in the state assembly district with the same value for the state assembly district id and any contact in the state senate district with a matching state senate district id. These contacts, along with the static contacts, get a copy of the petition.

Want to try?

We haven't yet released it formally as an extension because it is still being tested. But that doesn't mean you can't give it a spin. In fact, we'd like that very much. It currently lives in the dynamic-targets branch of our git repo. If you find a problem, please let us know by opening an issue.



Jamie, if I'm reading this right, you've uncoupled the address to electoral district lookup in an elegant way that will allow campaigns in other countries to use this so long as they do the lookup on contact save before the rest of the page processes. Is this correct?! Thanks!!

Yes - exactly :). The only draw back is that it requires a lot more user intervention and configuration to put the pieces together. However, I think the trade-off is worth it.

This is a really exciting development - filling a key gap in CiviCRM support for advocacy and activism. Thanks to PTP for building AND sharing it. (Let's make sure this gets announced in the January community newsletter!

"Whitelisting" on the receiving end?

Jamie, we use Salsa for such petitions and sending e-mails to electeds, rather than Civi. How can users of this extension deal with "whitelisting" on the receiving elected officials' end - meaning, how can we make sure that e-mails sent go through and don't get dumped orr ignored as "spam"? Salsa sells that as a key reason to pay for its service. Thoughts? 

Also, how is the pricing for Cicero? 

Eager to check the extension out. Thanks!


Hi Joe - Cicero pricing is here:

Unfortunately, deliverability will depend on the email server you use to relay your messages. Since we are limited to email, there is not a lot that you can do. However, we have found that the most effective online petitions are ones that target local officials with hundreds of messages. While national reps have sophisticated systems to avoid spam (e.g. filter some of their constituents!) most local reps will know when you bombard them with that many email messages.

A missing feature would be a way to handle filling out web forms (I believe that is part of what Salsa does to reach elected officials who don't publish their email addresses).