aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet
diff options
context:
space:
mode:
Diffstat (limited to 'perllib/FixMyStreet')
-rw-r--r--perllib/FixMyStreet/App/Controller/Report/New.pm2
-rw-r--r--perllib/FixMyStreet/Cobrand/Bromley.pm8
-rw-r--r--perllib/FixMyStreet/Queue/Item/Report.pm2
3 files changed, 10 insertions, 2 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Report/New.pm b/perllib/FixMyStreet/App/Controller/Report/New.pm
index 98ebd4972..f64a109e8 100644
--- a/perllib/FixMyStreet/App/Controller/Report/New.pm
+++ b/perllib/FixMyStreet/App/Controller/Report/New.pm
@@ -1676,7 +1676,7 @@ sub redirect_or_confirm_creation : Private {
$c->forward( 'create_related_things' );
if ($c->stash->{contributing_as_another_user} && $report->user->email
&& $report->user->id != $c->user->id
- && !$c->cobrand->report_sent_confirmation_email) {
+ && !$c->cobrand->report_sent_confirmation_email($report)) {
$c->send_email( 'other-reported.txt', {
to => [ [ $report->user->email, $report->name ] ],
} );
diff --git a/perllib/FixMyStreet/Cobrand/Bromley.pm b/perllib/FixMyStreet/Cobrand/Bromley.pm
index 176762323..5fc03eb81 100644
--- a/perllib/FixMyStreet/Cobrand/Bromley.pm
+++ b/perllib/FixMyStreet/Cobrand/Bromley.pm
@@ -379,6 +379,14 @@ sub munge_load_and_group_problems {
}
}
+# We want to send confirmation emails only for Waste reports
+sub report_sent_confirmation_email {
+ my ($self, $report) = @_;
+ my $contact = $report->contact or return;
+ return 'id' if grep { $_ eq 'Waste' } @{$report->contact->groups};
+ return '';
+}
+
sub munge_around_category_where {
my ($self, $where) = @_;
$where->{extra} = [ undef, { -not_like => '%Waste%' } ];
diff --git a/perllib/FixMyStreet/Queue/Item/Report.pm b/perllib/FixMyStreet/Queue/Item/Report.pm
index 60e9ad3dc..070b244bb 100644
--- a/perllib/FixMyStreet/Queue/Item/Report.pm
+++ b/perllib/FixMyStreet/Queue/Item/Report.pm
@@ -243,7 +243,7 @@ sub _send {
sub _post_send {
my ($self, $result) = @_;
- my $send_confirmation_email = $self->cobrand_handler->report_sent_confirmation_email;
+ my $send_confirmation_email = $self->cobrand_handler->report_sent_confirmation_email($self->report);
unless ($result) {
$self->report->update( {
whensent => \'current_timestamp',