diff options
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Alert.pm')
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Alert.pm | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Alert.pm b/perllib/FixMyStreet/App/Controller/Alert.pm index 7ea0d77e3..b836f5a79 100644 --- a/perllib/FixMyStreet/App/Controller/Alert.pm +++ b/perllib/FixMyStreet/App/Controller/Alert.pm @@ -140,7 +140,12 @@ sub subscribe_email : Private { } $c->forward('create_alert'); - $c->forward('send_confirmation_email'); + if ( $c->stash->{alert}->confirmed ) { + $c->stash->{confirm_type} = 'created'; + $c->stash->{template} = 'alert/confirm.html'; + } else { + $c->forward('send_confirmation_email'); + } } sub updates : Path('updates') : Args(0) { @@ -190,14 +195,13 @@ sub create_alert : Private { unless ($alert) { $options->{cobrand} = $c->cobrand->moniker(); $options->{cobrand_data} = $c->cobrand->extra_update_data(); + $options->{confirmed} = 1 if $c->stash->{alert_user}->in_storage; $alert = $c->model('DB::Alert')->new($options); $alert->insert(); } $c->stash->{alert} = $alert; - - $c->log->debug( 'created alert ' . $alert->id ); } =head2 set_update_alert_options |