diff options
Diffstat (limited to 'perllib/FixMyStreet')
-rw-r--r-- | perllib/FixMyStreet/Cobrand/Bexley.pm | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/perllib/FixMyStreet/Cobrand/Bexley.pm b/perllib/FixMyStreet/Cobrand/Bexley.pm index 1b960f206..95c9aac84 100644 --- a/perllib/FixMyStreet/Cobrand/Bexley.pm +++ b/perllib/FixMyStreet/Cobrand/Bexley.pm @@ -111,11 +111,6 @@ sub open311_post_send { # Check Open311 was successful return unless $row->external_id; - if ($row->category eq 'Abandoned and untaxed vehicles') { - my $burnt = $row->get_extra_field_value('burnt') || ''; - return unless $burnt eq 'Yes'; - } - my @lighting = ( 'Lamp post', 'Light in multi-storey car park', @@ -136,10 +131,15 @@ sub open311_post_send { my $emails = $self->feature('open311_email') || return; my $dangerous = $row->get_extra_field_value('dangerous') || ''; - my $reportType = $row->get_extra_field_value('reportType') || ''; my $p1_email = 0; - if ($row->category eq 'Parks and open spaces') { + if ($row->category eq 'Abandoned and untaxed vehicles') { + my $burnt = $row->get_extra_field_value('burnt') || ''; + $p1_email = 1 if $burnt eq 'Yes'; + } elsif ($row->category eq 'Dead animal') { + $p1_email = 1; + } elsif ($row->category eq 'Parks and open spaces') { + my $reportType = $row->get_extra_field_value('reportType') || ''; $p1_email = 1 if $reportType =~ /locked in a park|Wild animal/; $p1_email = 1 if $dangerous eq 'Yes' && $reportType =~ /Playgrounds|park furniture|gates are broken|Vandalism|Other/; } elsif (!$lighting{$row->category}) { @@ -147,7 +147,7 @@ sub open311_post_send { } my @to; - if ($row->category eq 'Abandoned and untaxed vehicles' || $row->category eq 'Dead animal' || $p1_email) { + if ($p1_email) { push @to, [ $emails->{p1}, 'Bexley P1 email' ] if $emails->{p1}; } if ($lighting{$row->category} && $emails->{lighting}) { @@ -158,6 +158,12 @@ sub open311_post_send { my @flooding = split /,/, $emails->{flooding}; push @to, [ $_, 'FixMyStreet Bexley Flooding' ] for @flooding; } + if ($contact->email =~ /^Uniform/ && $emails->{eh}) { + my @eh = split ',', $emails->{eh}; + push @to, [ $_, 'FixMyStreet Bexley EH' ] for @eh; + $row->push_extra_fields({ name => 'uniform_id', description => 'Uniform ID', value => $row->external_id }); + } + return unless @to; my $sender = FixMyStreet::SendReport::Email->new( to => \@to ); |