aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/SendReport
diff options
context:
space:
mode:
Diffstat (limited to 'perllib/FixMyStreet/SendReport')
-rw-r--r--perllib/FixMyStreet/SendReport/Zurich.pm10
1 files changed, 10 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/SendReport/Zurich.pm b/perllib/FixMyStreet/SendReport/Zurich.pm
index a5df06ee3..2838440cb 100644
--- a/perllib/FixMyStreet/SendReport/Zurich.pm
+++ b/perllib/FixMyStreet/SendReport/Zurich.pm
@@ -9,11 +9,21 @@ sub build_recipient_list {
# Only one body ever, most of the time with an email endpoint
my $body = @{ $self->bodies }[0];
+
+ # we set external_message (but default to '' in case of race condition e.g.
+ # Wunsch set, but external_message hasn't yet been filled in. TODO should
+ # we instead be holding off sending?)
if ( $row->external_body ) {
$body = FixMyStreet::App->model("DB::Body")->find( { id => $row->external_body } );
$h->{bodies_name} = $body->name;
$h->{external_message} = $row->get_extra_metadata('external_message') || '';
}
+ $h->{external_message} //= '';
+
+ my ($west, $nord) = $row->local_coords;
+ $h->{west} = $west;
+ $h->{nord} = $nord;
+
my $body_email = $body->endpoint;
my $parent = $body->parent;