aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/SendReport/Email/Highways.pm
diff options
context:
space:
mode:
authorMarius Halden <marius.h@lden.org>2021-10-07 13:32:40 +0200
committerMarius Halden <marius.h@lden.org>2021-10-07 13:32:40 +0200
commit09dacfc6b8bf62addeee16c20b1d90c2a256da96 (patch)
tree7caa2bf9e92227ab74448f9b746dd28bbcb81b2a /perllib/FixMyStreet/SendReport/Email/Highways.pm
parent585e57484f9c6332668bf1ac0a6a3b39dbe32223 (diff)
parentcea89fb87a96943708a1db0f646492fbfaaf000f (diff)
Merge tag 'v3.1' into fiksgatami-devfiksgatami-dev
Diffstat (limited to 'perllib/FixMyStreet/SendReport/Email/Highways.pm')
-rw-r--r--perllib/FixMyStreet/SendReport/Email/Highways.pm13
1 files changed, 8 insertions, 5 deletions
diff --git a/perllib/FixMyStreet/SendReport/Email/Highways.pm b/perllib/FixMyStreet/SendReport/Email/Highways.pm
index 2bcd120d3..3ace07b6a 100644
--- a/perllib/FixMyStreet/SendReport/Email/Highways.pm
+++ b/perllib/FixMyStreet/SendReport/Email/Highways.pm
@@ -12,11 +12,14 @@ 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;
- }
+
+ # config is read-only, so must step through one-by-one to prevent
+ # vivification
+ my $area_email = FixMyStreet->config('COBRAND_FEATURES') || {};
+ $area_email = $area_email->{open311_email} || {};
+ $area_email = $area_email->{highwaysengland} || {};
+ $area_email = $area_email->{$area_name};
+ $email = $area_email if $area_email;
@{$self->to} = map { [ $_, $body->name ] } split /,/, $email;
return 1;