There isn’t room for all my target emails

In your hosting management (cpanel?) create a series of email forwarders; something like speakout@yourdomain.com for each email address.

for example

  • speakout@yourdomain.com -> mayor@mycity.com
  • speakout@yourdomain.com -> police-chief@mycity.com
  • speakout@yourdomain.com -> councillor@mycity.com

Then make that forwarder (speakout@example.com) your target email in the petition.

So when the petition is sent to speakout@yourdomain.com it is forwarded to everyone in your list.

That is tedious, can I change the code?

Firstly, backup your database:

Then in your database, in the table wp_dk_speakout_petitions change the target_email from type VARCHAR (300) to LONGTEXT – this allows more data to be stored in the database table. I am deliberately being a bit vague as if you don’t know how to do this based on the minimal information, you shouldn’t be messing with the database 😛

Next, make a copy of /wp-content/plugins/speakout/includes/addnew.view.php

Open the original file search for

<input name=”target_email” id=”target_email” value=”<?php echo esc_attr( $petition->target_email ); ?>” size=”40″ maxlength=”300″ type=”text” />

remove the text maxlength=”300″ so that the line becomes

<input name=”target_email” id=”target_email” value=”<?php echo esc_attr( $petition->target_email ); ?>” size=”40″ type=”text” />

this removes the restriction on the number of characters allowed in the form field.

You may also want to increase the width of the field by over-riding the CSS styling. You do this by adding style=”width:100%”

So the final code becomes

<input name=”target_email” id=”target_email” value=”<?php echo esc_attr( $petition->target_email ); ?>” size=”40″ type=”text” style=”width:100%” />

However note that this is liable to be over-written whenever an update has changes to this file…which is often.