WriteToThem (home)

How to link to us

Wouldn't it be great if you could put a little box on your website which would let your users get in touch with their elected representatives. Well, you can!

Before you do so, make sure you read the guidelines for campaigners. You must not tell your users to send cut-and-paste messages — they are against our conditions of use and we will block them.

Envelope style box

writetothem.com

To add the postcode box to your site, copy the HTML code given below into your own webpage.

<!-- WriteToThem envelope box, start -->
<script type="text/javascript">
    function clearDefault(el) {
      if (el.defaultValue==el.value) el.value = "";
    }
    function fillDefault(el) {
      if (el.value=="") el.value = "Your Postcode";
    }
</script>
<div style="width:167px;height:120px;
    background: url(http://www.writetothem.com/envelope_bg.gif) no-repeat 0 0; 
    font:9pt/11pt arial,helvetica,sans-serif;position:relative;">
    <form method="get" action="http://www.writetothem.com/">
        <div style="padding:55px 0 0 20px;">
            <label for="pc" style="display:none;">
                Contact Your Politician
            </label>
            <input type="text" value="Your Postcode" name="pc" size="13"
                style="width:90px;vertical-align:bottom;
                    font:8pt/11pt arial,helvetica,sans-serif;color:#666;" 
                onfocus="clearDefault(this)" onblur="fillDefault(this)" />
            <input type="image" value="Go" style="vertical-align:bottom;" 
                src="http://www.writetothem.com/envelope_arrow.gif" />
        </div>
    </form>
    <a href="http://www.writetothem.com/" title="Visit writetothem.com" 
    style="display:block;position:absolute;bottom:0;width:100%;overflow:hidden;
    text-indent:-1234em;height:30px;bottom:0;">writetothem.com</a>
</div>
<!-- WriteToThem envelope box, end-->

Conventional style box

Contact Your Politician
Enter your Postcode below:

To add the postcode box to your site, copy the HTML code given below into your own webpage.

<!-- WriteToThem conventional box, start -->
<div style="padding:0; border:1px solid #999999; width:14em; margin: 0;
            background-color:#FFE88C; font: 83% Helvetica, Arial, sans-serif;">
    <form method="get" action="http://www.writetothem.com/" style="text-align:center">
        <div style="background-color:#D0BF69;padding:3px; color:#2B3260;">
                <strong>Contact Your Politician</strong>
        </div>
        <div style="margin:0.5em; color:#2B3260; background-color: #ffe88c;">
            <div style="margin-bottom:0.25em;">Enter your Postcode below:</div>
            <input type="text" name="pc" size="13">
            <input type="submit" value="Go">
        </div>
    </form>
</div>
<!-- WriteToThem conventional box, end-->

Feel free to hack around with the design as much as you like. Any questions, just drop us a line.

Linking to specific types of representative

You can also link to a specific type of representative. For example, if people on your website are writing only to their MP, use an address like this.

http://www.writetothem.com/?a=westminstermp

Or if you are using a form to link to us, add this code to your form. It goes just after the postcode <input> field, and before the submit/go button one.

<input type="hidden" name="a" value="westminstermp">

Possible values for "a" in both cases are:

There are some more detailed three letter codes that you can use instead. Put these in a list as the value of "a", separated by commas ",".

So, for example, this would only show representatives of district type councils. For people entering postcodes in unitary areas, it would say there were no representatives of that type and offer to show them all their representatives.

<input type="hidden" name="a" value="DIW,LBO">

Prefilling name and address

If you already know the name, address or email of the person using your website, you can send the values to WriteToThem. They will then be defaults for the letter. The person writing the letter can check or alter them before sending.

<input type="hidden" name="writer_email" value="name@email.address">

The fields available are:

Plugins for WordPress

Philip John has made a WordPress plugin for WriteToThem, that lets you easily add a WriteToThem form to your WordPress site as a standard WordPress widget.

There is also a much older WordPress plugin, written by Richard Pope, that needs you to alter your PHP template.