aboutsummaryrefslogtreecommitdiffstats
path: root/perllib
diff options
context:
space:
mode:
Diffstat (limited to 'perllib')
-rw-r--r--perllib/FixMyStreet/Cobrand/BathNES.pm2
-rw-r--r--perllib/FixMyStreet/Cobrand/Buckinghamshire.pm2
-rw-r--r--perllib/FixMyStreet/Cobrand/Default.pm2
-rw-r--r--perllib/FixMyStreet/Cobrand/Lincolnshire.pm2
-rw-r--r--perllib/FixMyStreet/Script/Reports.pm12
5 files changed, 15 insertions, 5 deletions
diff --git a/perllib/FixMyStreet/Cobrand/BathNES.pm b/perllib/FixMyStreet/Cobrand/BathNES.pm
index e3ae6763f..e26e846c3 100644
--- a/perllib/FixMyStreet/Cobrand/BathNES.pm
+++ b/perllib/FixMyStreet/Cobrand/BathNES.pm
@@ -151,7 +151,7 @@ sub available_permissions {
return $permissions;
}
-sub report_sent_confirmation_email { 1 }
+sub report_sent_confirmation_email { 'id' }
sub lookup_usrn {
my $self = shift;
diff --git a/perllib/FixMyStreet/Cobrand/Buckinghamshire.pm b/perllib/FixMyStreet/Cobrand/Buckinghamshire.pm
index ef5b53356..3a33d6f58 100644
--- a/perllib/FixMyStreet/Cobrand/Buckinghamshire.pm
+++ b/perllib/FixMyStreet/Cobrand/Buckinghamshire.pm
@@ -447,7 +447,7 @@ sub should_skip_sending_update {
sub disable_phone_number_entry { 1 }
-sub report_sent_confirmation_email { 1 }
+sub report_sent_confirmation_email { 'external_id' }
sub is_council_with_case_management { 1 }
diff --git a/perllib/FixMyStreet/Cobrand/Default.pm b/perllib/FixMyStreet/Cobrand/Default.pm
index 946523626..ed15dbf05 100644
--- a/perllib/FixMyStreet/Cobrand/Default.pm
+++ b/perllib/FixMyStreet/Cobrand/Default.pm
@@ -1031,7 +1031,7 @@ sub report_check_for_errors {
);
}
-sub report_sent_confirmation_email { 0; }
+sub report_sent_confirmation_email { '' }
=item never_confirm_reports
diff --git a/perllib/FixMyStreet/Cobrand/Lincolnshire.pm b/perllib/FixMyStreet/Cobrand/Lincolnshire.pm
index a4cee8a03..8d8ba3268 100644
--- a/perllib/FixMyStreet/Cobrand/Lincolnshire.pm
+++ b/perllib/FixMyStreet/Cobrand/Lincolnshire.pm
@@ -20,7 +20,7 @@ sub is_two_tier { 1 }
sub enable_category_groups { 1 }
sub send_questionnaires { 0 }
-sub report_sent_confirmation_email { 1 }
+sub report_sent_confirmation_email { 'external_id' }
sub admin_user_domain { 'lincolnshire.gov.uk' }
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;