aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHakim Cassimally <hakim@mysociety.org>2015-02-25 18:04:58 +0000
committerDave Arter <davea@mysociety.org>2015-10-06 09:09:22 +0100
commit1c4f12860c2aee9e9fa3063969c3d995dda1871f (patch)
tree203c6f278c8a1c4afa5e0bd72e762d30d90be9c7
parent232cdef2681c64ddf3bfe70a08d88c2e5f4683fa (diff)
[Zurich] Vary confirmation email wording if address is confirmed
See mysociety/FixMyStreet-Commercial#669
-rw-r--r--perllib/FixMyStreet/App/Controller/Report/New.pm3
-rw-r--r--perllib/FixMyStreet/Cobrand/Zurich.pm9
-rw-r--r--templates/email/zurich/problem-confirm.txt2
3 files changed, 13 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Report/New.pm b/perllib/FixMyStreet/App/Controller/Report/New.pm
index d5b84815b..b55152693 100644
--- a/perllib/FixMyStreet/App/Controller/Report/New.pm
+++ b/perllib/FixMyStreet/App/Controller/Report/New.pm
@@ -1162,6 +1162,9 @@ sub redirect_or_confirm_creation : Private {
}
} );
$c->stash->{token_url} = $c->uri_for_email( '/P', $token->token );
+ if ($c->cobrand->can('problem_confirm_email_extras')) {
+ $c->cobrand->problem_confirm_email_extras($report);
+ }
$c->send_email( $template, {
to => [ $report->name ? [ $report->user->email, $report->name ] : $report->user->email ],
} );
diff --git a/perllib/FixMyStreet/Cobrand/Zurich.pm b/perllib/FixMyStreet/Cobrand/Zurich.pm
index cded2c62d..5c6566b62 100644
--- a/perllib/FixMyStreet/Cobrand/Zurich.pm
+++ b/perllib/FixMyStreet/Cobrand/Zurich.pm
@@ -851,4 +851,13 @@ sub admin_stats {
return 1;
}
+sub problem_confirm_email_extras {
+ my ($self, $report) = @_;
+ my $confirmed_reports = $report->user->problems->search({
+ extra => { like => '%email_confirmed%' },
+ })->count;
+
+ $self->{c}->stash->{email_confirmed} = $confirmed_reports;
+}
+
1;
diff --git a/templates/email/zurich/problem-confirm.txt b/templates/email/zurich/problem-confirm.txt
index b945c6d59..32c3b89be 100644
--- a/templates/email/zurich/problem-confirm.txt
+++ b/templates/email/zurich/problem-confirm.txt
@@ -2,7 +2,7 @@ Subject: Züri wie neu: Meldung #[% report.id %]
Grüezi [% report.name %]
-Besten Dank für Ihre Meldung auf <<Züri wie neu>>. Klicken Sie bitte auf diesen Link, um Ihre E-Mail-Adresse zu bestätigen und über den Status der Meldung informiert zu bleiben. Falls der Link nicht funktioniert, kopieren Sie ihn in Ihren Browser:
+Besten Dank für Ihre Meldung auf <<Züri wie neu>>. Klicken Sie bitte auf diesen Link, um[% UNLESS email_confirmed %] Ihre E-Mail-Adresse zu bestätigen und[% END %] über den Status der Meldung informiert zu bleiben. Falls der Link nicht funktioniert, kopieren Sie ihn in Ihren Browser:
[% token_url %]