Sha256: 387d0da2f00d30d37dfe7d23e9b03fb970eb47f655f000a9e41672c09d187bf6

Contents?: true

Size: 739 Bytes

Versions: 8

Compression:

Stored size: 739 Bytes

Contents

module PostageApp::Mail::Extensions
  def self.install!
    # Register PostageApp as a valid Mail delivery method, allows the shorthand
    # Mail.delivery_method :postageapp
    ::Mail::Configuration.class_eval do
      alias_method :__base_lookup_delivery_method, :lookup_delivery_method

      # This requires wrapping around the lookup_delivery_method method to
      # add a new case. Unlike ActionMailer there is no way to register new
      # delivery methods.
      def lookup_delivery_method(method)
        case (method.is_a?(String) ? method.to_sym : method)
        when :postageapp
          PostageApp::Mail::DeliveryMethod
        else
          __base_lookup_delivery_method(method)
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
postageapp-1.4.2 lib/postageapp/mail/extensions.rb
postageapp-1.4.1 lib/postageapp/mail/extensions.rb
postageapp-1.4.0 lib/postageapp/mail/extensions.rb
postageapp-1.3.1 lib/postageapp/mail/extensions.rb
postageapp-1.3.0 lib/postageapp/mail/extensions.rb
postageapp-1.2.6 lib/postageapp/mail/extensions.rb
postageapp-1.2.5 lib/postageapp/mail/extensions.rb
postageapp-1.2.0 lib/postageapp/mail/extensions.rb