Sha256: 94b3224f16d8ab2c06e1b5b41180a177d09f5fedcbe56d72d85ee7e4ade75202

Contents?: true

Size: 902 Bytes

Versions: 4

Compression:

Stored size: 902 Bytes

Contents

module StatusCat
  module Checkers
    class ActionMailer < Base

      def initialize
        @value = "#{config[ :address ]}:#{config[ :port ]}"

        unless  ::ActionMailer::Base.delivery_method == :test
          @status = fail_on_exception do
            address        = config[ :address ]
            port           = config[ :port ]
            domain         = config[ :domain ]
            user_name      = config[ :user_name ]
            password       = config[ :password ]
            authentication = config[ :authentication ]

            Net::SMTP.start( address, port, domain, user_name, password, authentication ) do |smtp|
              smtp.send_message( '', StatusCat.config.from, StatusCat.config.noreply )
            end
            nil
          end
        end
      end

      def config
        @config ||= ::ActionMailer::Base.smtp_settings
      end

    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
status_cat-0.1.1 lib/status_cat/checkers/action_mailer.rb
status_cat-0.1.0 lib/status_cat/checkers/action_mailer.rb
status_cat-0.0.9 lib/status_cat/checkers/action_mailer.rb
status_cat-0.0.8 lib/status_cat/checkers/action_mailer.rb