diff options
author | Matthew Somerville <matthew@cake.ukcod.org.uk> | 2010-03-31 16:01:48 +0100 |
---|---|---|
committer | Matthew Somerville <matthew@cake.ukcod.org.uk> | 2010-03-31 16:01:48 +0100 |
commit | 18e0bbffddd736a0fa0dc469b364777ce8a573ab (patch) | |
tree | b5cf33e3ea204b24579e0c2f58de6618b670b08e | |
parent | 3a8f3ea15b8508d7873120fcc1a46bf2650b821c (diff) |
Oxfordshire split by area.
-rwxr-xr-x | bin/send-reports | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/bin/send-reports b/bin/send-reports index 30a3b3235..9abc9c6c0 100755 --- a/bin/send-reports +++ b/bin/send-reports @@ -145,6 +145,7 @@ foreach my $row (@$unsent) { "SELECT email,confirmed,note FROM contacts WHERE deleted='f' and area_id=? AND category=?", {}, $council, $row->{category}); $council_email = essex_contact($row->{easting}, $row->{northing}) if $council == 2225; + $council_email = oxfordshire_contact($row->{easting}, $row->{northing}) if $council == 2237 && $council_email eq 'SPECIAL'; unless ($confirmed) { $all_confirmed = 0; $note = 'Council ' . $row->{council} . ' deleted' @@ -276,6 +277,18 @@ sub essex_contact { return "highways.$email\@essexcc.gov.uk"; } +# Oxfordshire has different contact addresses depending upon the district +sub oxfordshire_contact { + my ($E, $N) = @_; + my $district = mySociety::MaPit::get_voting_areas_by_location({easting=>$E, northing=>$N}, 'polygon', 'DIS'); + ($district) = keys %$district; + my $email; + $email = 'northernarea' if $district == 2419 || $district == 2420 || $district == 2421; + $email = 'southernarea' if $district == 2417 || $district == 2418; + die "Returned district $district which is not in Oxfordshire!" unless $email; + return "$email\@oxfordshire.gov.uk"; +} + sub construct_easthants_message { my %h = @_; my $message = ''; |