Module: PostmarkInstaller

Extended by:
PostmarkInstaller
Included in:
PostmarkInstaller
Defined in:
lib/postmark-rails.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) auto_detect_and_install



8
9
10
11
12
13
14
# File 'lib/postmark-rails.rb', line 8

def auto_detect_and_install
  if ActionMailer::Base.respond_to?(:add_delivery_method)
    install_in_rails_3
  else
    install_in_rails_2
  end
end

- (Object) install_in_rails_2



16
17
18
# File 'lib/postmark-rails.rb', line 16

def install_in_rails_2
  ActionMailer::Base.send(:include, PostmarkDeliveryMethod)
end

- (Object) install_in_rails_3



20
21
22
23
# File 'lib/postmark-rails.rb', line 20

def install_in_rails_3
  ActionMailer::Base.add_delivery_method :postmark, Mail::Postmark, :api_key => nil
  Mail::Message.send(:include, Postmark::AttachmentsFixForMail)
end