diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-04-06 18:57:05 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-04-06 18:57:05 +0000 |
commit | fde9c7315ac6667091e5e7f2260850896e9ae35a (patch) | |
tree | 3acab005adf82c258dbf7d258ab750baabc4ed1f /app | |
parent | cfb06a2607e338931af0aa1f126c32e3290c4dc2 (diff) | |
download | redmine-fde9c7315ac6667091e5e7f2260850896e9ae35a.tar.gz redmine-fde9c7315ac6667091e5e7f2260850896e9ae35a.zip |
Fixed: reminder mails are not sent when delivery_method is :async_smtp (#5058).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9367 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rw-r--r-- | app/models/mailer.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/app/models/mailer.rb b/app/models/mailer.rb index 22b99edf6..96bb83c57 100644 --- a/app/models/mailer.rb +++ b/app/models/mailer.rb @@ -372,6 +372,17 @@ class Mailer < ActionMailer::Base ActionMailer::Base.perform_deliveries = was_enabled end + # Sends emails synchronously in the given block + def self.with_synched_deliveries(&block) + saved_method = ActionMailer::Base.delivery_method + if m = saved_method.to_s.match(%r{^async_(.+)$}) + ActionMailer::Base.delivery_method = m[1].to_sym + end + yield + ensure + ActionMailer::Base.delivery_method = saved_method + end + private def initialize_defaults(method_name) super |