From e08f14c4501f315b46c2a45b2f63b572ab650691 Mon Sep 17 00:00:00 2001 From: M Somerville Date: Mon, 2 Nov 2020 09:25:08 +0000 Subject: [Highways England] Expand across non-DBFO roads. --- perllib/FixMyStreet/SendReport/Email/Highways.pm | 8 +++----- t/app/sendreport/email/highways.t | 2 +- templates/web/highwaysengland/report/new/roads_message.html | 7 +++---- web/cobrands/highwaysengland/assets.js | 6 +++--- 4 files changed, 10 insertions(+), 13 deletions(-) diff --git a/perllib/FixMyStreet/SendReport/Email/Highways.pm b/perllib/FixMyStreet/SendReport/Email/Highways.pm index 2bcd120d3..918ac896d 100644 --- a/perllib/FixMyStreet/SendReport/Email/Highways.pm +++ b/perllib/FixMyStreet/SendReport/Email/Highways.pm @@ -12,11 +12,9 @@ sub build_recipient_list { my $contact = $self->fetch_category($body, $row) or return; my $email = $contact->email; my $area_name = $row->get_extra_field_value('area_name') || ''; - if ($area_name eq 'Area 7') { - my $a7email = FixMyStreet->config('COBRAND_FEATURES') || {}; - $a7email = $a7email->{open311_email}->{highwaysengland}->{area_seven}; - $email = $a7email if $a7email; - } + my $area_email = FixMyStreet->config('COBRAND_FEATURES') || {}; + $area_email = $area_email->{open311_email}->{highwaysengland}->{$area_name}; + $email = $area_email if $area_email; @{$self->to} = map { [ $_, $body->name ] } split /,/, $email; return 1; diff --git a/t/app/sendreport/email/highways.t b/t/app/sendreport/email/highways.t index b9a71f23f..22913a7e6 100644 --- a/t/app/sendreport/email/highways.t +++ b/t/app/sendreport/email/highways.t @@ -34,7 +34,7 @@ is $e->build_recipient_list($row), 1, 'correct recipient list count'; is_deeply $e->to, [ [ 'highways@example.com', 'Highways England' ] ], 'correct To line'; FixMyStreet::override_config { - COBRAND_FEATURES => { open311_email => { highwaysengland => { area_seven => 'a7@example.com' } } } + COBRAND_FEATURES => { open311_email => { highwaysengland => { 'Area 7' => 'a7@example.com' } } } }, sub { $row->set_extra_fields( { name => 'area_name', value => 'Area 7' } ); is $e->build_recipient_list($row), 1, 'correct recipient list count'; diff --git a/templates/web/highwaysengland/report/new/roads_message.html b/templates/web/highwaysengland/report/new/roads_message.html index e75a0a01b..d09845daf 100644 --- a/templates/web/highwaysengland/report/new/roads_message.html +++ b/templates/web/highwaysengland/report/new/roads_message.html @@ -7,10 +7,9 @@

-