Sha256: 7e76482e9ff22225a26e2fb56a722de491a808105c7c3615e76146851c62738d

Contents?: true

Size: 561 Bytes

Versions: 17

Compression:

Stored size: 561 Bytes

Contents

require 'sidekiq/extensions/generic_proxy'

module Sidekiq
  module Extensions
    ##
    # Adds a 'delay' method to ActionMailer to offload arbitrary email
    # delivery to Sidekiq.  Example:
    #
    #    UserMailer.delay.send_welcome_email(new_user)
    class DelayedMailer
      include Sidekiq::Worker

      def perform(yml)
        (target, method_name, args) = YAML.load(yml)
        target.send(method_name, *args).deliver
      end
    end

    module ActionMailer
      def delay
        Proxy.new(DelayedMailer, self)
      end
    end

  end
end

Version data entries

17 entries across 17 versions & 2 rubygems

Version Path
kulesa-sidekiq-1.2.3 lib/sidekiq/extensions/action_mailer.rb
kulesa-sidekiq-1.2.2 lib/sidekiq/extensions/action_mailer.rb
sidekiq-1.2.1 lib/sidekiq/extensions/action_mailer.rb
sidekiq-1.2.0 lib/sidekiq/extensions/action_mailer.rb
sidekiq-1.1.4 lib/sidekiq/extensions/action_mailer.rb
sidekiq-1.1.3 lib/sidekiq/extensions/action_mailer.rb
sidekiq-1.1.2 lib/sidekiq/extensions/action_mailer.rb
sidekiq-1.1.1 lib/sidekiq/extensions/action_mailer.rb
sidekiq-1.1.0 lib/sidekiq/extensions/action_mailer.rb
sidekiq-1.0.0 lib/sidekiq/extensions/action_mailer.rb
sidekiq-0.11.2 lib/sidekiq/extensions/action_mailer.rb
sidekiq-0.11.1 lib/sidekiq/extensions/action_mailer.rb
sidekiq-0.11.0 lib/sidekiq/extensions/action_mailer.rb
sidekiq-0.10.1 lib/sidekiq/extensions/action_mailer.rb
sidekiq-0.10.0 lib/sidekiq/extensions/action_mailer.rb
sidekiq-0.9.1 lib/sidekiq/extensions/action_mailer.rb
sidekiq-0.9.0 lib/sidekiq/extensions/action_mailer.rb