some more rails stuff
This commit is contained in:
parent
2fad5f7c92
commit
a46c4083ae
6 changed files with 36 additions and 3 deletions
|
@ -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
|
||||
|
|
12
app/models/notifier.rb
Normal file
12
app/models/notifier.rb
Normal file
|
@ -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
|
|
@ -18,8 +18,8 @@
|
|||
|
||||
|
||||
<span id="greeting">
|
||||
<%= 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'} %>
|
||||
</span>
|
||||
|
||||
<div>
|
||||
|
|
8
app/views/notifier/signup_confirm.rhtml
Normal file
8
app/views/notifier/signup_confirm.rhtml
Normal file
|
@ -0,0 +1,8 @@
|
|||
Hi,
|
||||
|
||||
Somone (hopefully you) would like to create an account over at
|
||||
www.openstreetmap.org
|
||||
|
||||
If this is you, please click the link below to confirm that account.
|
||||
|
||||
<%= @url %>
|
1
app/views/user/signup.rhtml
Normal file
1
app/views/user/signup.rhtml
Normal file
|
@ -0,0 +1 @@
|
|||
blah
|
|
@ -50,4 +50,11 @@ end
|
|||
# inflect.uncountable %w( fish sheep )
|
||||
# end
|
||||
|
||||
# Include your application configuration below
|
||||
# Include your application configuration below
|
||||
|
||||
|
||||
ActionMailer::Base.server_settings = {
|
||||
:address => "localhost",
|
||||
:port => 25,
|
||||
:domain => 'localhost',
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue