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 pre-written, identical letters — they are against our conditions of use and we will block them.
To add the envelope-style postcode box to your site, just copy the HTML code 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(https://www.writetothem.com/envelope_bg.gif) no-repeat 0 0;
font:9pt/11pt arial,helvetica,sans-serif;position:relative;">
<form method="get" action="https://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="https://www.writetothem.com/envelope_arrow.gif" />
</div>
</form>
<a href="https://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-->
To add the conventional postcode box to your site, copy the HTML code 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="https://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. If you have any questions, just drop us a line.
If you only want to encourage people to write to one kind of representative - for example, only to their MP, link to WriteToThem using an address like this:
https://www.writetothem.com/?a=westminstermp
Or if you are using one of the boxes, above, 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:
westminstermp
— just your MPcouncil
— all local government councillors (in some areas this will return
district and county councillors, in others unitary authority councillors)regionalmp
— members of the Scottish Parliament, Senedd, Northern Ireland Assembly, or London AssemblyThere 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 ",".
DIW
– district council, LBW
– London BoroughMTW
– metropolitan district, UTW
and UTE
– Unitary authority,
LGE
– Local government district (Northern Ireland), COP
– Council of the Isles (Scilly)CED
LAC
– constituency members, LAE
– list membersWAC
– constituency members, WAE
– list membersSPC
– constituency members, SPE
– list membersNIE
WMC
So, for example, the link below 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,LBW">
If you already know the name, address or email of the person using your website (ie if they are logged in) or reading your newsletter, you can send the values to WriteToThem.
Your supporters will be able to check or alter them before sending.
<input type="hidden" name="writer_email" value="name@email.address">
The fields available are:
writer_name
writer_address1
writer_address2
writer_town
writer_county
writer_email
writer_phone
Philip John (not affiliated to WriteToThem, but working voluntarily) has made a WordPress plugin.
It lets you add a WriteToThem form to your WordPress site as a standard WordPress widget - so it’s just drag-and-drop to install.
There is also a much older WordPress plugin, written by Richard Pope. To use that, you will need to alter your PHP template.
Please address support queries about these plug-ins to their authors, on the plug-ins’ pages.