summaryrefslogtreecommitdiffstats
path: root/app/models/mailer.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2007-11-18 17:46:55 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2007-11-18 17:46:55 +0000
commit9c9ae217716304f7062fc31c2f4e4f8adafee2b1 (patch)
treeca10cbe2297f5a2a77cbbe33a81acd436f597e17 /app/models/mailer.rb
parentf8aa2dc9b71640a4da008e8ef0968a8cd9ce7385 (diff)
downloadredmine-9c9ae217716304f7062fc31c2f4e4f8adafee2b1.tar.gz
redmine-9c9ae217716304f7062fc31c2f4e4f8adafee2b1.zip
There's now 3 account activation strategies (available in application settings):
* activation by email: the user receives an email containing a link to active his account * manual activation: an email is sent to administrators for account approval (default) * automatic activation: the user can log in as soon as he has registered git-svn-id: http://redmine.rubyforge.org/svn/trunk@915 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/mailer.rb')
-rw-r--r--app/models/mailer.rb10
1 files changed, 9 insertions, 1 deletions
diff --git a/app/models/mailer.rb b/app/models/mailer.rb
index aa372120d..fe432e9a6 100644
--- a/app/models/mailer.rb
+++ b/app/models/mailer.rb
@@ -88,6 +88,14 @@ class Mailer < ActionMailer::Base
:password => password,
:login_url => url_for(:controller => 'account', :action => 'login')
end
+
+ def account_activation_request(user)
+ # Send the email to all active administrators
+ recipients User.find_active(:all, :conditions => {:admin => true}).collect { |u| u.mail }.compact
+ subject l(:mail_subject_account_activation_request)
+ body :user => user,
+ :url => url_for(:controller => 'users', :action => 'index', :status => User::STATUS_REGISTERED, :sort_key => 'created_on', :sort_order => 'desc')
+ end
def lost_password(token)
set_language_if_valid(token.user.language)
@@ -102,7 +110,7 @@ class Mailer < ActionMailer::Base
recipients token.user.mail
subject l(:mail_subject_register)
body :token => token,
- :url => url_for(:controller => 'account', :action => 'register', :token => token.value)
+ :url => url_for(:controller => 'account', :action => 'activate', :token => token.value)
end
def test(user)