aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/Open311.pm
diff options
context:
space:
mode:
Diffstat (limited to 'perllib/Open311.pm')
-rw-r--r--perllib/Open311.pm12
1 files changed, 6 insertions, 6 deletions
diff --git a/perllib/Open311.pm b/perllib/Open311.pm
index da5a0a377..90b593256 100644
--- a/perllib/Open311.pm
+++ b/perllib/Open311.pm
@@ -127,13 +127,15 @@ sub _populate_service_request_params {
my ( $firstname, $lastname ) = ( $problem->name =~ /(\w+)\.?\s+(.+)/ );
my $params = {
- email => $problem->user->email,
description => $description,
service_code => $service_code,
first_name => $firstname,
last_name => $lastname || '',
};
+ $params->{phone} = $problem->user->phone if $problem->user->phone;
+ $params->{email} = $problem->user->email if $problem->user->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
@@ -153,10 +155,6 @@ sub _populate_service_request_params {
$params->{address_string} = $problem->postcode;
}
- if ( $problem->user->phone ) {
- $params->{ phone } = $problem->user->phone;
- }
-
if ( $extra->{image_url} ) {
$params->{media_url} = $extra->{image_url};
}
@@ -327,12 +325,14 @@ sub _populate_service_request_update_params {
updated_datetime => DateTime::Format::W3CDTF->format_datetime($comment->confirmed->set_nanosecond(0)),
service_request_id => $comment->problem->external_id,
status => $status,
- email => $comment->user->email,
description => $comment->text,
last_name => $lastname,
first_name => $firstname,
};
+ $params->{phone} = $comment->user->phone if $comment->user->phone;
+ $params->{email} = $comment->user->email if $comment->user->email;
+
if ( $self->use_extended_updates ) {
$params->{public_anonymity_required} = $comment->anonymous ? 'TRUE' : 'FALSE',
$params->{update_id_ext} = $comment->id;