Sha256: 3fd7998e9936b2e56302451727d4fc9d6ca8badba24d8a5ffd83bbe09f026734
Contents?: true
Size: 490 Bytes
Versions: 27
Compression:
Stored size: 490 Bytes
Contents
require 'mail' module Delayed class PerformableMailer < PerformableMethod def perform mailer = object.send(method_name, *args) 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
27 entries across 27 versions & 4 rubygems