aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/Script
diff options
context:
space:
mode:
Diffstat (limited to 'perllib/FixMyStreet/Script')
-rw-r--r--perllib/FixMyStreet/Script/Reports.pm12
1 files changed, 11 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/Script/Reports.pm b/perllib/FixMyStreet/Script/Reports.pm
index ba629b016..1fef6fe08 100644
--- a/perllib/FixMyStreet/Script/Reports.pm
+++ b/perllib/FixMyStreet/Script/Reports.pm
@@ -127,10 +127,19 @@ sub send(;$) {
$missing = join(' / ', @missing) if @missing;
}
+ my $send_confirmation_email = $cobrand->report_sent_confirmation_email;
+
my @dear;
my %reporters = ();
my $skip = 0;
while (my $body = $bodies->next) {
+ # See if this body wants confirmation email (in case report made on national site, for example)
+ if (my $cobrand_body = $body->get_cobrand_handler) {
+ if (my $id_ref = $cobrand_body->report_sent_confirmation_email) {
+ $send_confirmation_email = $id_ref;
+ }
+ }
+
my $sender_info = $cobrand->get_body_sender( $body, $row->category );
my $sender = "FixMyStreet::SendReport::" . $sender_info->{method};
@@ -243,7 +252,8 @@ sub send(;$) {
whensent => \'current_timestamp',
lastupdate => \'current_timestamp',
} );
- if ( $cobrand->report_sent_confirmation_email && !$h{anonymous_report}) {
+ if ($send_confirmation_email && !$h{anonymous_report}) {
+ $h{sent_confirm_id_ref} = $row->$send_confirmation_email;
_send_report_sent_email( $row, \%h, $nomail, $cobrand );
}
debug_print("send successful: OK", $row->id) if $debug_mode;