diff options
-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 = ''; |