diff options
-rw-r--r-- | perllib/FixMyStreet/Cobrand/Zurich.pm | 18 | ||||
-rw-r--r-- | templates/email/zurich/problem-closed.txt | 17 | ||||
-rwxr-xr-x | templates/email/zurich/problem-confirm.txt | 2 | ||||
-rw-r--r-- | templates/email/zurich/problem-external.txt | 15 | ||||
-rw-r--r-- | templates/email/zurich/problem-rejected.txt | 12 |
5 files changed, 63 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/Cobrand/Zurich.pm b/perllib/FixMyStreet/Cobrand/Zurich.pm index 8082697bc..1c4718da7 100644 --- a/perllib/FixMyStreet/Cobrand/Zurich.pm +++ b/perllib/FixMyStreet/Cobrand/Zurich.pm @@ -215,9 +215,13 @@ sub admin_report_edit { $problem->state( 'closed' ); $problem->external_body( $external ); $problem->whensent( undef ); + _admin_send_email( $c, 'problem-external.txt', $problem ); $redirect = 1; } else { $problem->state( $c->req->params->{state} ) if $c->req->params->{state}; + if ( $problem->state eq 'hidden' ) { + _admin_send_email( $c, 'problem-rejected.txt', $problem ); + } } $problem->title( $c->req->param('title') ); @@ -229,6 +233,7 @@ sub admin_report_edit { $problem->extra( { %$extra } ); if ($c->req->params->{publish_response}) { $problem->state( 'fixed - council' ); + _admin_send_email( $c, 'problem-closed.txt', $problem ); } } @@ -316,4 +321,17 @@ sub admin_report_edit { } +sub _admin_send_email { + my ( $c, $template, $problem ) = @_; + + my $to = $problem->name + ? [ $problem->user->email, $problem->name ] + : $problem->user->email; + + $c->send_email( $template, { + to => [ $to ], + url => $c->uri_for_email( $problem->url ), + } ); +} + 1; diff --git a/templates/email/zurich/problem-closed.txt b/templates/email/zurich/problem-closed.txt new file mode 100644 index 000000000..c6286b993 --- /dev/null +++ b/templates/email/zurich/problem-closed.txt @@ -0,0 +1,17 @@ +Subject: FixMyZurich: Meldung #[% problem.id %] + +Guten Tag [% problem.name %] + +The following update has been left on your report: + +[% problem.extra.public_response %] + +To view your report on the site, please visit: + [% url %] + +Ihre Meldung: + +[% problem.detail %] + +Dieses E-Mail wurde automatisch generiert. Bitte antworten Sie nicht auf dieses E-Mail. + diff --git a/templates/email/zurich/problem-confirm.txt b/templates/email/zurich/problem-confirm.txt index 636bb3dfb..401591681 100755 --- a/templates/email/zurich/problem-confirm.txt +++ b/templates/email/zurich/problem-confirm.txt @@ -8,6 +8,6 @@ Bitte klicken Sie auf den untenstehenden Link, um Ihre Meldung zu bestätigen. F Ihre Meldung: -[% report.details %] +[% report.detail %] Dieses E-Mail wurde automatisch generiert. Bitte antworten Sie nicht auf dieses E-Mail. diff --git a/templates/email/zurich/problem-external.txt b/templates/email/zurich/problem-external.txt new file mode 100644 index 000000000..4778111b4 --- /dev/null +++ b/templates/email/zurich/problem-external.txt @@ -0,0 +1,15 @@ +Subject: FixMyZurich: Meldung #[% problem.id %] + +Guten Tag [% problem.name %] + +Your report has been forwarded to [% problem.body(c).name %] for them to deal with. + +To view your report on the site, please visit: + [% url %] + +Ihre Meldung: + +[% problem.detail %] + +Dieses E-Mail wurde automatisch generiert. Bitte antworten Sie nicht auf dieses E-Mail. + diff --git a/templates/email/zurich/problem-rejected.txt b/templates/email/zurich/problem-rejected.txt new file mode 100644 index 000000000..b6790a809 --- /dev/null +++ b/templates/email/zurich/problem-rejected.txt @@ -0,0 +1,12 @@ +Subject: Fix my Zurich: Meldung #[% problem.id %] + +Guten Tag [% problem.name %] + +I am afraid that your report has been rejected, for being inappropriate for the site. + +Ihre Meldung: + +[% problem.detail %] + +Dieses E-Mail wurde automatisch generiert. Bitte antworten Sie nicht auf dieses E-Mail. + |