diff options
Diffstat (limited to 'perllib/FixMyStreet/SendReport/EmptyHomes.pm')
-rw-r--r-- | perllib/FixMyStreet/SendReport/EmptyHomes.pm | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/perllib/FixMyStreet/SendReport/EmptyHomes.pm b/perllib/FixMyStreet/SendReport/EmptyHomes.pm index b29c1fd3c..4bae6af46 100644 --- a/perllib/FixMyStreet/SendReport/EmptyHomes.pm +++ b/perllib/FixMyStreet/SendReport/EmptyHomes.pm @@ -33,15 +33,20 @@ sub build_recipient_list { push @{ $self->to }, [ $body_email, $body->name ]; $recips{$body_email} = 1; - my $area_info = mySociety::MaPit::call('area', $body->area_id); + my $area_info = mySociety::MaPit::call('area', $body->body_areas->first->area_id); my $country = $area_info->{country}; if ($country eq 'W') { - $recips{ 'shelter@' . mySociety::Config::get('EMAIL_DOMAIN') } = 1; + $recips{ 'wales@' . mySociety::Config::get('EMAIL_DOMAIN') } = 1; + } elsif ($country eq 'S') { + $recips{ 'scotland@' . mySociety::Config::get('EMAIL_DOMAIN') } = 1; } else { $recips{ 'eha@' . mySociety::Config::get('EMAIL_DOMAIN') } = 1; } } + # Set address email parameter from added data + $h->{address} = $row->extra->{address}; + return () unless $all_confirmed; return keys %recips; } |