diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb index da27a95dc..42460b4e0 100644 --- a/app/controllers/user_controller.rb +++ b/app/controllers/user_controller.rb @@ -1,5 +1,10 @@ class UserController < ApplicationController + def create + # do some checks, find the user then send the mail + Notifier::deliver_confirm_signup(user) + end + def new end diff --git a/app/models/notifier.rb b/app/models/notifier.rb new file mode 100644 index 000000000..484cb702f --- /dev/null +++ b/app/models/notifier.rb @@ -0,0 +1,12 @@ +class Notifier < ActionMailer::Base + + def signup_confirm( user ) + # Email header info MUST be added here + @recipients = user.email + @from = 'abuse@openstreetmap.org' + @subject = '[OpenStreetMap] Confirm your email address' + + @body['url'] = 'http://www.openstreetmap.org/user/confirm?confirm_string=' + user.token + end + +end diff --git a/app/views/layouts/user.rhtml b/app/views/layouts/user.rhtml index dc90025bb..3d8287fcd 100644 --- a/app/views/layouts/user.rhtml +++ b/app/views/layouts/user.rhtml @@ -18,8 +18,8 @@ - <%= link_to 'Login', :controller => 'user', :action => 'login' %> / - <%= link_to 'Sign up', :controller => 'user', :action => 'new' %> + <%= link_to 'Login', {:controller => 'user', :action => 'login'}, {:id => 'loginanchor'}%> / + <%= link_to 'Sign up', {:controller => 'user', :action => 'new'}, {:id => 'registeranchor'} %>