class UserController < ApplicationController
+ def create
+ # do some checks, find the user then send the mail
+ Notifier::deliver_confirm_signup(user)
+ end
+
def new
end
--- /dev/null
+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
<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>
--- /dev/null
+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 %>
# inflect.uncountable %w( fish sheep )
# end
-# Include your application configuration below
\ No newline at end of file
+# Include your application configuration below
+
+
+ActionMailer::Base.server_settings = {
+ :address => "localhost",
+ :port => 25,
+ :domain => 'localhost',
+}