Class: Workarea::MailInterceptor

Inherits:
Object
  • Object
show all
Defined in:
lib/workarea/mail_interceptor.rb

Class Method Summary collapse

Class Method Details

.deliver?(message) ⇒ Boolean

Returns:

  • (Boolean)


7
8
9
10
11
12
13
# File 'lib/workarea/mail_interceptor.rb', line 7

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

.delivering_email(message) ⇒ Object



3
4
5
# File 'lib/workarea/mail_interceptor.rb', line 3

def self.delivering_email(message)
  message.perform_deliveries = false unless deliver?(message)
end