diff options
Diffstat (limited to 'perllib/FixMyStreet/SendReport')
-rw-r--r-- | perllib/FixMyStreet/SendReport/Email.pm | 27 | ||||
-rw-r--r-- | perllib/FixMyStreet/SendReport/Open311.pm | 3 |
2 files changed, 2 insertions, 28 deletions
diff --git a/perllib/FixMyStreet/SendReport/Email.pm b/perllib/FixMyStreet/SendReport/Email.pm index 4507091c7..fa4d437fb 100644 --- a/perllib/FixMyStreet/SendReport/Email.pm +++ b/perllib/FixMyStreet/SendReport/Email.pm @@ -18,9 +18,6 @@ sub build_recipient_list { my ($body_email, $confirmed, $note) = ( $contact->email, $contact->confirmed, $contact->note ); - $body_email = essex_contact($row->latitude, $row->longitude) if $body->areas->{2225}; - $body_email = oxfordshire_contact($row->latitude, $row->longitude) if $body->areas->{2237} && $body_email eq 'SPECIAL'; - unless ($confirmed) { $all_confirmed = 0; $note = 'Body ' . $row->bodies_str . ' deleted' @@ -112,30 +109,6 @@ sub send { return $result; } -# Essex has different contact addresses depending upon the district -# Might be easier if we start storing in the db all areas covered by a point -# Will do for now :) -sub essex_contact { - my $district = _get_district_for_contact(@_); - my $email; - $email = 'eastarea' if $district == 2315 || $district == 2312; - $email = 'midarea' if $district == 2317 || $district == 2314 || $district == 2316; - $email = 'southarea' if $district == 2319 || $district == 2320 || $district == 2310; - $email = 'westarea' if $district == 2309 || $district == 2311 || $district == 2318 || $district == 2313; - die "Returned district $district which is not in Essex!" unless $email; - return "highways.$email\@essexcc.gov.uk"; -} - -# Oxfordshire has different contact addresses depending upon the district -sub oxfordshire_contact { - my $district = _get_district_for_contact(@_); - 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 _get_district_for_contact { my ( $lat, $lon ) = @_; my $district = diff --git a/perllib/FixMyStreet/SendReport/Open311.pm b/perllib/FixMyStreet/SendReport/Open311.pm index cfcac9bd8..fa216466e 100644 --- a/perllib/FixMyStreet/SendReport/Open311.pm +++ b/perllib/FixMyStreet/SendReport/Open311.pm @@ -13,6 +13,7 @@ use Readonly; Readonly::Scalar my $COUNCIL_ID_OXFORDSHIRE => 2237; Readonly::Scalar my $COUNCIL_ID_WARWICKSHIRE => 2243; +Readonly::Scalar my $COUNCIL_ID_GREENWICH => 2493; sub send { my $self = shift; @@ -127,7 +128,7 @@ sub send { $revert = 1; } - if ($row->cobrand eq 'fixmybarangay' || $row->cobrand eq 'greenwich') { + if ($row->cobrand eq 'fixmybarangay' || $row->bodies_str =~ /$COUNCIL_ID_GREENWICH/) { # FixMyBarangay endpoints expect external_id as an attribute, as do Greenwich $row->set_extra_fields( { 'name' => 'external_id', 'value' => $row->id } ); $revert = 1; |