some more rails stuff

This commit is contained in:
Steve Coast 2006-07-28 22:53:54 +00:00
parent 2fad5f7c92
commit a46c4083ae
6 changed files with 36 additions and 3 deletions

View file

@ -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
View 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

View file

@ -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>

View 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 %>

View file

@ -0,0 +1 @@
blah

View file

@ -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',
}