replace Mailer deliver syntax to Rails3 style

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9638 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA
2012-05-05 13:07:12 +00:00
parent e876d1bfc0
commit 7af8d7caf0
16 changed files with 60 additions and 58 deletions
+3 -3
View File
@@ -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?
+1 -1
View File
@@ -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)
+3 -1
View File
@@ -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
+1 -1
View File
@@ -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
+3 -3
View File
@@ -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|
+1 -1
View File
@@ -18,7 +18,7 @@
class CommentObserver < ActiveRecord::Observer
def after_create(comment)
if comment.commented.is_a?(News) && Setting.notified_events.include?('news_comment_added')
Mailer.deliver_news_comment_added(comment)
Mailer.news_comment_added(comment).deliver
end
end
end
+1 -1
View File
@@ -17,6 +17,6 @@
class DocumentObserver < ActiveRecord::Observer
def after_create(document)
Mailer.deliver_document_added(document) if Setting.notified_events.include?('document_added')
Mailer.document_added(document).deliver if Setting.notified_events.include?('document_added')
end
end
+1 -1
View File
@@ -17,6 +17,6 @@
class IssueObserver < ActiveRecord::Observer
def after_create(issue)
Mailer.deliver_issue_add(issue) if Setting.notified_events.include?('issue_added')
Mailer.issue_add(issue).deliver if Setting.notified_events.include?('issue_added')
end
end
+1 -1
View File
@@ -23,7 +23,7 @@ class JournalObserver < ActiveRecord::Observer
(Setting.notified_events.include?('issue_status_updated') && journal.new_status.present?) ||
(Setting.notified_events.include?('issue_priority_updated') && journal.new_value_for('priority_id').present?)
)
Mailer.deliver_issue_edit(journal)
Mailer.issue_edit(journal).deliver
end
end
end
+1 -1
View File
@@ -94,7 +94,7 @@ class MailHandler < ActionMailer::Base
if logger && logger.info
logger.info "MailHandler: [#{@user.login}] account created"
end
Mailer.deliver_account_information(@user, @user.password)
Mailer.account_information(@user, @user.password).deliver
else
if logger && logger.error
logger.error "MailHandler: could not create account for [#{sender_email}]"
+1 -1
View File
@@ -17,6 +17,6 @@
class MessageObserver < ActiveRecord::Observer
def after_create(message)
Mailer.deliver_message_posted(message) if Setting.notified_events.include?('message_posted')
Mailer.message_posted(message).deliver if Setting.notified_events.include?('message_posted')
end
end
+1 -1
View File
@@ -17,6 +17,6 @@
class NewsObserver < ActiveRecord::Observer
def after_create(news)
Mailer.deliver_news_added(news) if Setting.notified_events.include?('news_added')
Mailer.news_added(news).deliver if Setting.notified_events.include?('news_added')
end
end
+2 -2
View File
@@ -17,12 +17,12 @@
class WikiContentObserver < ActiveRecord::Observer
def after_create(wiki_content)
Mailer.deliver_wiki_content_added(wiki_content) if Setting.notified_events.include?('wiki_content_added')
Mailer.wiki_content_added(wiki_content).deliver if Setting.notified_events.include?('wiki_content_added')
end
def after_update(wiki_content)
if wiki_content.text_changed?
Mailer.deliver_wiki_content_updated(wiki_content) if Setting.notified_events.include?('wiki_content_updated')
Mailer.wiki_content_updated(wiki_content).deliver if Setting.notified_events.include?('wiki_content_updated')
end
end
end