diff options
Diffstat (limited to 'actionmailer/lib/action_mailer')
-rw-r--r-- | actionmailer/lib/action_mailer/async.rb | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/actionmailer/lib/action_mailer/async.rb b/actionmailer/lib/action_mailer/async.rb index cbadd3dc25..fd62c57790 100644 --- a/actionmailer/lib/action_mailer/async.rb +++ b/actionmailer/lib/action_mailer/async.rb @@ -27,8 +27,14 @@ module ActionMailer::Async end # Will push the message onto the Queue to be processed - def deliver - Rails.queue << self + # To force message delivery dispite async pass `true` + # Emailer.welcome.deliver(true) + def deliver(force = false) + if force + run + else + Rails.queue << self + end end # The original ActionMailer message |