diff options
author | Struan Donald <struan@exo.org.uk> | 2012-12-18 17:41:13 +0000 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2012-12-18 17:41:13 +0000 |
commit | 863508e157993787e3587930fea9428aeeffabea (patch) | |
tree | c442d4668cc33e92d8c57017367f26c61aa5014c /perllib/FixMyStreet/DB/ResultSet/Problem.pm | |
parent | 3ad1e2a793319d8ef817e57c96bafbd5e6780dbe (diff) |
do not send report sent confirmation emails for anonymous reports
Diffstat (limited to 'perllib/FixMyStreet/DB/ResultSet/Problem.pm')
-rw-r--r-- | perllib/FixMyStreet/DB/ResultSet/Problem.pm | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/DB/ResultSet/Problem.pm b/perllib/FixMyStreet/DB/ResultSet/Problem.pm index 282ffaea3..09fd6158a 100644 --- a/perllib/FixMyStreet/DB/ResultSet/Problem.pm +++ b/perllib/FixMyStreet/DB/ResultSet/Problem.pm @@ -288,6 +288,12 @@ sub send_reports { $h{closest_address} = $cobrand->find_closest( $h{latitude}, $h{longitude}, $row ); } + if ( $cobrand->allow_anonymous_reports && + $row->user->email eq $cobrand->anonymous_account->{'email'} + ) { + $h{anonymous_report} = 1; + } + my %reporters = (); my ( $sender_count ); if ($site eq 'emptyhomes') { @@ -395,7 +401,7 @@ sub send_reports { whensent => \'ms_current_timestamp()', lastupdate => \'ms_current_timestamp()', } ); - if ( $cobrand->report_sent_confirmation_email ) { + if ( $cobrand->report_sent_confirmation_email && !$h{anonymous_report}) { _send_report_sent_email( $row, \%h, $nomail ); } } else { |