summaryrefslogtreecommitdiffstats
path: root/app/controllers
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2012-05-05 13:07:12 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2012-05-05 13:07:12 +0000
commit7af8d7caf06416a1d9b94f061a6d0b28fc6bc2d9 (patch)
tree740ef4bf2bd455d4730e086dc8908515e1b0ad96 /app/controllers
parente876d1bfc014a51ce5e1178bc57529c37c517c45 (diff)
downloadredmine-7af8d7caf06416a1d9b94f061a6d0b28fc6bc2d9.tar.gz
redmine-7af8d7caf06416a1d9b94f061a6d0b28fc6bc2d9.zip
replace Mailer deliver syntax to Rails3 style
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9638 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/account_controller.rb6
-rw-r--r--app/controllers/admin_controller.rb2
-rw-r--r--app/controllers/documents_controller.rb4
-rw-r--r--app/controllers/files_controller.rb2
-rw-r--r--app/controllers/users_controller.rb6
5 files changed, 11 insertions, 9 deletions
diff --git a/app/controllers/account_controller.rb b/app/controllers/account_controller.rb
index d44741678..fa530087e 100644
--- a/app/controllers/account_controller.rb
+++ b/app/controllers/account_controller.rb
@@ -68,7 +68,7 @@ class AccountController < ApplicationController
# create a new token for password recovery
token = Token.new(:user => user, :action => "recovery")
if token.save
- Mailer.deliver_lost_password(token)
+ Mailer.lost_password(token).deliver
flash[:notice] = l(:notice_account_lost_email_sent)
redirect_to :action => 'login'
return
@@ -235,7 +235,7 @@ class AccountController < ApplicationController
def register_by_email_activation(user, &block)
token = Token.new(:user => user, :action => "register")
if user.save and token.save
- Mailer.deliver_register(token)
+ Mailer.register(token).deliver
flash[:notice] = l(:notice_account_register_done)
redirect_to :action => 'login'
else
@@ -265,7 +265,7 @@ class AccountController < ApplicationController
def register_manually_by_administrator(user, &block)
if user.save
# Sends an email to the administrators
- Mailer.deliver_account_activation_request(user)
+ Mailer.account_activation_request(user).deliver
account_pending
else
yield if block_given?
diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb
index 6e961dad9..e8cccca85 100644
--- a/app/controllers/admin_controller.rb
+++ b/app/controllers/admin_controller.rb
@@ -63,7 +63,7 @@ class AdminController < ApplicationController
# Force ActionMailer to raise delivery errors so we can catch it
ActionMailer::Base.raise_delivery_errors = true
begin
- @test = Mailer.deliver_test_email(User.current)
+ @test = Mailer.test_email(User.current).deliver
flash[:notice] = l(:notice_email_sent, User.current.mail)
rescue Exception => e
flash[:error] = l(:notice_email_error, e.message)
diff --git a/app/controllers/documents_controller.rb b/app/controllers/documents_controller.rb
index 96be5631a..b3c82eeb0 100644
--- a/app/controllers/documents_controller.rb
+++ b/app/controllers/documents_controller.rb
@@ -86,7 +86,9 @@ class DocumentsController < ApplicationController
attachments = Attachment.attach_files(@document, params[:attachments])
render_attachment_warning_if_needed(@document)
- Mailer.deliver_attachments_added(attachments[:files]) if attachments.present? && attachments[:files].present? && Setting.notified_events.include?('document_added')
+ if attachments.present? && attachments[:files].present? && Setting.notified_events.include?('document_added')
+ Mailer.attachments_added(attachments[:files]).deliver
+ end
redirect_to :action => 'show', :id => @document
end
end
diff --git a/app/controllers/files_controller.rb b/app/controllers/files_controller.rb
index d21aa5e14..f96cd4a9f 100644
--- a/app/controllers/files_controller.rb
+++ b/app/controllers/files_controller.rb
@@ -46,7 +46,7 @@ class FilesController < ApplicationController
render_attachment_warning_if_needed(container)
if !attachments.empty? && !attachments[:files].blank? && Setting.notified_events.include?('file_added')
- Mailer.deliver_attachments_added(attachments[:files])
+ Mailer.attachments_added(attachments[:files]).deliver
end
redirect_to project_files_path(@project)
end
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index 44aa41037..3b42e7e54 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -99,7 +99,7 @@ class UsersController < ApplicationController
@user.pref.save
@user.notified_project_ids = (@user.mail_notification == 'selected' ? params[:notified_project_ids] : [])
- Mailer.deliver_account_information(@user, params[:user][:password]) if params[:send_information]
+ Mailer.account_information(@user, params[:user][:password]).deliver if params[:send_information]
respond_to do |format|
format.html {
@@ -146,9 +146,9 @@ class UsersController < ApplicationController
@user.notified_project_ids = (@user.mail_notification == 'selected' ? params[:notified_project_ids] : [])
if was_activated
- Mailer.deliver_account_activated(@user)
+ Mailer.account_activated(@user).deliver
elsif @user.active? && params[:send_information] && !params[:user][:password].blank? && @user.auth_source_id.nil?
- Mailer.deliver_account_information(@user, params[:user][:password])
+ Mailer.account_information(@user, params[:user][:password]).deliver
end
respond_to do |format|