diff options
author | Struan Donald <struan@exo.org.uk> | 2012-05-24 15:09:06 +0100 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2012-05-24 15:09:06 +0100 |
commit | 65820a534a42852d0d9a1819649f48a54b37c22f (patch) | |
tree | 73fb2c02bdaf20d5e9053e7f6ab2f784fa4e3de8 /perllib/Open311.pm | |
parent | 47979155279b45b9bb4b12b57cde49c6bf00681f (diff) |
send media_url if comment has a photo
Diffstat (limited to 'perllib/Open311.pm')
-rw-r--r-- | perllib/Open311.pm | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/perllib/Open311.pm b/perllib/Open311.pm index 0d3c0720d..2df6ac5dd 100644 --- a/perllib/Open311.pm +++ b/perllib/Open311.pm @@ -278,6 +278,13 @@ sub _populate_service_request_update_params { first_name => $firstname, }; + if ( $comment->photo ) { + my $cobrand = FixMyStreet::Cobrand->get_class_for_moniker($comment->cobrand)->new(); + my $email_base_url = $cobrand->base_url_for_emails($comment->cobrand_data); + my $url = $email_base_url . '/photos/c/' . $comment->id . '.full.jpeg'; + $params->{media_url} = $url; + } + if ( $comment->extra ) { $params->{'email_alerts_requested'} = $comment->extra->{email_alerts_requested} ? 'TRUE' : 'FALSE'; |