Defect #11376 ยป async_parameter.patch
| app/models/mailer.rb (working copy) | ||
|---|---|---|
|
|
||
|
def self.deliver_mail(mail)
|
||
|
return false if mail.to.blank? && mail.cc.blank? && mail.bcc.blank?
|
||
|
if self.async
|
||
|
Thread.start do
|
||
|
super
|
||
|
end
|
||
|
return true
|
||
|
end
|
||
|
super
|
||
|
end
|
||
| config/initializers/10-patches.rb (working copy) | ||
|---|---|---|
|
require 'mail'
|
||
|
module ActionMailer
|
||
|
class Base
|
||
|
cattr_accessor :async
|
||
|
end
|
||
|
end
|
||
|
|
||
|
module DeliveryMethods
|
||
|
class AsyncSMTP < ::Mail::SMTP
|
||
|
def deliver!(*args)
|
||
|
ActiveSupport::Deprecation.warn "async_smtp delivery method is deprecated and will be removed in Redmine 2.2. Use the async property at email_delivery level instead."
|
||
|
Thread.start do
|
||
|
super *args
|
||
|
end
|
||
| ... | ... | |
|
class AsyncSendmail < ::Mail::Sendmail
|
||
|
def deliver!(*args)
|
||
|
ActiveSupport::Deprecation.warn "async_sendmail delivery method is deprecated and will be removed in Redmine 2.2. Use the async property at email_delivery level instead."
|
||
|
Thread.start do
|
||
|
super *args
|
||
|
end
|
||