Sha256: 720e496090b561ea3b5be45ecbabe1f6361daf6d9a3c33e6dfc771859183a4a3

Contents?: true

Size: 365 Bytes

Versions: 62

Compression:

Stored size: 365 Bytes

Contents

module Workarea
  class MailInterceptor
    def self.delivering_email(message)
      message.perform_deliveries = false unless deliver?(message)
    end

    def self.deliver?(message)
      if Workarea.config.send_email.respond_to?(:call)
        Workarea.config.send_email.call(message)
      else
        !!Workarea.config.send_email
      end
    end
  end
end

Version data entries

62 entries across 62 versions & 1 rubygems

Version Path
workarea-core-3.5.27 lib/workarea/mail_interceptor.rb
workarea-core-3.5.26 lib/workarea/mail_interceptor.rb
workarea-core-3.4.45 lib/workarea/mail_interceptor.rb
workarea-core-3.5.25 lib/workarea/mail_interceptor.rb
workarea-core-3.5.23 lib/workarea/mail_interceptor.rb
workarea-core-3.4.44 lib/workarea/mail_interceptor.rb
workarea-core-3.5.22 lib/workarea/mail_interceptor.rb
workarea-core-3.4.43 lib/workarea/mail_interceptor.rb
workarea-core-3.5.21 lib/workarea/mail_interceptor.rb
workarea-core-3.4.42 lib/workarea/mail_interceptor.rb
workarea-core-3.5.20 lib/workarea/mail_interceptor.rb
workarea-core-3.4.41 lib/workarea/mail_interceptor.rb
workarea-core-3.5.19 lib/workarea/mail_interceptor.rb
workarea-core-3.4.40 lib/workarea/mail_interceptor.rb
workarea-core-3.5.18 lib/workarea/mail_interceptor.rb
workarea-core-3.4.39 lib/workarea/mail_interceptor.rb
workarea-core-3.5.17 lib/workarea/mail_interceptor.rb
workarea-core-3.4.38 lib/workarea/mail_interceptor.rb
workarea-core-3.5.16 lib/workarea/mail_interceptor.rb
workarea-core-3.4.37 lib/workarea/mail_interceptor.rb