module Pony

Pony monkey-patch.

Public Class Methods

_original_mail(options)
Alias for: mail
mail(options) click to toggle source
# File lib/postmortem/plugins/pony.rb, line 8
def mail(options)
  strategy = options[:via].to_s
  # Pony uses the Mail gem for smtp delivery so we catch these further down the stack to
  # avoid duplicating deliveries.
  return _original_mail(options) if strategy == 'smtp'

  # When delivery method is "test" we do not want to interfere as ActionMailer.deliveries
  # (which delegates to Mail::TestMailer) is typically used in tests.
  result = _original_mail(options) if strategy == 'test' || !Postmortem.config.mail_skip_delivery
  Postmortem.record_delivery(Postmortem::Adapters::Pony.new(options))
  result
end
Also aliased as: _original_mail