diff options
author | Struan Donald <struan@exo.org.uk> | 2011-05-26 14:33:50 +0100 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2011-05-26 14:33:50 +0100 |
commit | 408b256e4f863a43c4f81209106b4ac23aaa666a (patch) | |
tree | 24682056ebcd864676095583a3656eebc186a905 /perllib/FixMyStreet/App/Controller/Alert.pm | |
parent | 0030a9d9760c1f8733fb5b64486aaa634d1023bb (diff) |
If the user already exists in the database then don't sent them a
confirmation email when signing up to alerts
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 |