aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/Controller/Develop.pm
diff options
context:
space:
mode:
authorZarino Zappia <mail@zarino.co.uk>2019-08-20 11:16:53 +0100
committerZarino Zappia <mail@zarino.co.uk>2019-08-23 10:38:29 +0100
commit3c4d48f5fd5f499736f07ac2a5d17c1d4bab6c14 (patch)
tree59df44c764e803c679c01f17296a01fdb7813619 /perllib/FixMyStreet/App/Controller/Develop.pm
parent169c8960d9c32e35f5a2603c611857757d8b1044 (diff)
Include user admin links in contact form emails
If a message is sent via the contact form, with a stated email address matching a user in the database, the resulting email will now include quick links to: - Admin page for editing the user - Admin page for viewing the user’s reports And if the user has made at least one report, also: - Admin page for the user’s most recent report This should speed up admin email triage considerably.
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Develop.pm')
-rwxr-xr-xperllib/FixMyStreet/App/Controller/Develop.pm10
1 files changed, 10 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Develop.pm b/perllib/FixMyStreet/App/Controller/Develop.pm
index 38f0c2437..e6845ac02 100755
--- a/perllib/FixMyStreet/App/Controller/Develop.pm
+++ b/perllib/FixMyStreet/App/Controller/Develop.pm
@@ -130,6 +130,16 @@ sub email_previewer : Path('/_dev/email') : Args(1) {
);
$vars->{problem_url} = $c->cobrand->base_url() . '/report/' . $vars->{problem}->id;
$vars->{admin_url} = $c->cobrand->admin_base_url . '/report_edit/' . $vars->{problem}->id;
+ $vars->{user_admin_url} = $c->cobrand->admin_base_url . '/users/' . $c->user->id;
+ $vars->{user_reports_admin_url} = $c->cobrand->admin_base_url . '/reports?search=' . $c->user->email;
+ my $user_latest_problem = $c->user->problems->search({
+ state => [ FixMyStreet::DB::Result::Problem->visible_states() ]
+ }, {
+ order_by => { -desc => 'id' }
+ })->single;
+ if ( $user_latest_problem ) {
+ $vars->{user_latest_report_admin_url} = $c->cobrand->admin_base_url . '/report_edit/' . $user_latest_problem->id;
+ }
}
my $email = $c->construct_email("$template.txt", $vars);