diff options
author | Matthew Somerville <matthew@mysociety.org> | 2015-09-25 18:03:58 +0100 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2015-09-28 15:33:22 +0100 |
commit | 101cfc70b05960cd0fdd40580e0f45563ea7b58f (patch) | |
tree | 39cfae7a527297b6d50e63a271ba504af8b6f312 /perllib | |
parent | 99610f11646c3b8530dfdb19e08b11650569b9f6 (diff) |
Send altered confirmation email if not being sent.
Fixes #1210.
Diffstat (limited to 'perllib')
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Report/New.pm | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Report/New.pm b/perllib/FixMyStreet/App/Controller/Report/New.pm index de9f33105..d5b84815b 100644 --- a/perllib/FixMyStreet/App/Controller/Report/New.pm +++ b/perllib/FixMyStreet/App/Controller/Report/New.pm @@ -1149,6 +1149,9 @@ sub redirect_or_confirm_creation : Private { return 1; } + my $template = 'problem-confirm.txt'; + $template = 'problem-confirm-not-sending.txt' unless $report->bodies_str; + # otherwise create a confirm token and email it to them. my $data = $c->stash->{token_data} || {}; my $token = $c->model("DB::Token")->create( { @@ -1159,7 +1162,7 @@ sub redirect_or_confirm_creation : Private { } } ); $c->stash->{token_url} = $c->uri_for_email( '/P', $token->token ); - $c->send_email( 'problem-confirm.txt', { + $c->send_email( $template, { to => [ $report->name ? [ $report->user->email, $report->name ] : $report->user->email ], } ); |