aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2015-06-20 12:09:37 +0100
committerDave Arter <davea@mysociety.org>2015-10-06 09:09:24 +0100
commitff5e6664b9bf60ca62f9c632ea66d3413e67bcf3 (patch)
tree6a3a39186ab14ea5e3eaa006728c3790d52061d9 /perllib/FixMyStreet
parente7c35a0de101331436b1d5d6f2346a8c85233737 (diff)
[Zurich] Updated email templates
- submit-external-wish.txt includes a link with report's coordinates, template values are interpolated Conflicts: perllib/FixMyStreet/SendReport/Zurich.pm
Diffstat (limited to 'perllib/FixMyStreet')
-rw-r--r--perllib/FixMyStreet/Cobrand/Zurich.pm10
-rw-r--r--perllib/FixMyStreet/SendReport/Zurich.pm10
2 files changed, 20 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/Cobrand/Zurich.pm b/perllib/FixMyStreet/Cobrand/Zurich.pm
index 908550adb..3f57ecf5a 100644
--- a/perllib/FixMyStreet/Cobrand/Zurich.pm
+++ b/perllib/FixMyStreet/Cobrand/Zurich.pm
@@ -548,9 +548,18 @@ sub admin_report_edit {
#
# Note that 2 types of email may be sent
# 1) _admin_send_email() sends an email to the *user*, if their email is confirmed
+ #
# 2) setting $problem->whensent(undef) may make it eligible for generating an email
# to the body (internal or external). See DBRS::Problem->send_reports for Zurich-
# specific categories which are eligible for this.
+ #
+ # It looks like both of these will do:
+ # a) TT processing of [% ... %] directives, in FMS::App->send_email(_cron)
+ # b) pseudo-PHP substitution of <?=$values['name']?> which is done as
+ # naive substitution
+ # commonlib mySociety::Email
+ #
+ # So it makes sense to add new parameters as the more powerful TT (a).
my $redirect = 0;
my $new_cat = $c->get_param('category') || '';
@@ -858,6 +867,7 @@ sub _admin_send_email {
to => [ $to ],
url => $c->uri_for_email( $problem->url ),
from => [ $sender, $sender_name ],
+ problem => $problem,
} );
}
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;