Sha256: a38a10040e95b2bbeabf862cd7a40a93c7ba02cb6b6624348f401dd252abc41a

Contents?: true

Size: 464 Bytes

Versions: 7

Compression:

Stored size: 464 Bytes

Contents

require 'mail'

module Delayed
  class PerformableMailer < PerformableMethod
    def perform
      mailer = super
      mailer.respond_to?(:deliver_now) ? mailer.deliver_now : mailer.deliver
    end
  end

  module DelayMail
    def delay(options = {})
      DelayProxy.new(PerformableMailer, self, options)
    end
  end
end

Mail::Message.class_eval do
  def delay(*_args)
    raise 'Use MyMailer.delay.mailer_action(args) to delay sending of emails.'
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
delayed-0.5.5 lib/delayed/performable_mailer.rb
delayed-0.5.4 lib/delayed/performable_mailer.rb
delayed-0.5.3 lib/delayed/performable_mailer.rb
delayed-0.5.2 lib/delayed/performable_mailer.rb
delayed-0.5.1 lib/delayed/performable_mailer.rb
delayed-0.5.0 lib/delayed/performable_mailer.rb
delayed-0.4.0 lib/delayed/performable_mailer.rb