diff options
author | Hakim Cassimally <hakim@mysociety.org> | 2015-02-25 18:04:58 +0000 |
---|---|---|
committer | Dave Arter <davea@mysociety.org> | 2015-10-06 09:09:22 +0100 |
commit | 1c4f12860c2aee9e9fa3063969c3d995dda1871f (patch) | |
tree | 203c6f278c8a1c4afa5e0bd72e762d30d90be9c7 /perllib | |
parent | 232cdef2681c64ddf3bfe70a08d88c2e5f4683fa (diff) |
[Zurich] Vary confirmation email wording if address is confirmed
See mysociety/FixMyStreet-Commercial#669
Diffstat (limited to 'perllib')
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Report/New.pm | 3 | ||||
-rw-r--r-- | perllib/FixMyStreet/Cobrand/Zurich.pm | 9 |
2 files changed, 12 insertions, 0 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; |