aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--perllib/FixMyStreet/Cobrand/Bristol.pm6
-rw-r--r--perllib/Open311.pm7
2 files changed, 13 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/Cobrand/Bristol.pm b/perllib/FixMyStreet/Cobrand/Bristol.pm
index b11a52643..25dc5ab0a 100644
--- a/perllib/FixMyStreet/Cobrand/Bristol.pm
+++ b/perllib/FixMyStreet/Cobrand/Bristol.pm
@@ -71,4 +71,10 @@ sub categories_restriction {
return $rs->search( { 'me.send_method' => undef } );
}
+sub open311_config {
+ my ($self, $row, $h, $params) = @_;
+
+ $params->{always_send_email} = 1;
+}
+
1;
diff --git a/perllib/Open311.pm b/perllib/Open311.pm
index 90b593256..f4229d7ed 100644
--- a/perllib/Open311.pm
+++ b/perllib/Open311.pm
@@ -31,6 +31,7 @@ has extended_description => ( is => 'ro', isa => Str, default => 1 );
has use_service_as_deviceid => ( is => 'ro', isa => Bool, default => 0 );
has use_extended_updates => ( is => 'ro', isa => Bool, default => 0 );
has extended_statuses => ( is => 'ro', isa => Bool, default => 0 );
+has always_send_email => ( is => 'ro', isa => Bool, default => 0 );
before [
qw/get_service_list get_service_meta_info get_service_requests get_service_request_updates
@@ -136,6 +137,12 @@ sub _populate_service_request_params {
$params->{phone} = $problem->user->phone if $problem->user->phone;
$params->{email} = $problem->user->email if $problem->user->email;
+ # Some endpoints don't follow the Open311 spec correctly and require an
+ # email address for service requests.
+ if ($self->always_send_email && !$params->{email}) {
+ $params->{email} = FixMyStreet->config('DO_NOT_REPLY_EMAIL');
+ }
+
# if you click nearby reports > skip map then it's possible
# to end up with used_map = f and nothing in postcode
if ( $problem->used_map || $self->always_send_latlong