diff options
author | Brian Cardarella <bcardarella@gmail.com> | 2012-06-23 15:10:49 -0400 |
---|---|---|
committer | Brian Cardarella <bcardarella@gmail.com> | 2012-06-23 15:12:31 -0400 |
commit | dc9f6fc046dac3bf26dd37625e977e57a129ba8f (patch) | |
tree | 0b0ebddee90a369ac80d3c95bdf6c3c521dddbdb /actionmailer/lib/action_mailer | |
parent | b6792e91975a3cc9a6a5d5cf49532e90c8d3cc2a (diff) | |
download | rails-dc9f6fc046dac3bf26dd37625e977e57a129ba8f.tar.gz rails-dc9f6fc046dac3bf26dd37625e977e57a129ba8f.tar.bz2 rails-dc9f6fc046dac3bf26dd37625e977e57a129ba8f.zip |
Force message delivery despite async
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 |