Class: BaseMailer

Inherits:
ActionMailer::Base
  • Object
show all
Defined in:
lib/blackhole-mailer/base_mailer.rb

Overview

Offers subclasses a hook to abort deliver of a mail message.

Direct Known Subclasses

AsyncMailer

Defined Under Namespace

Classes: AbortDeliveryError

Instance Method Summary collapse

Instance Method Details

#abort_deliveryObject

Raises:



6
7
8
# File 'lib/blackhole-mailer/base_mailer.rb', line 6

def abort_delivery
  raise AbortDeliveryError
end

#process(*args) ⇒ Object



10
11
12
13
14
15
16
# File 'lib/blackhole-mailer/base_mailer.rb', line 10

def process(*args)
  begin
    super *args
  rescue AbortDeliveryError
    self.message = BlackholeMailMessage
  end
end