Class: IsItWorking::ActionMailerCheck

Inherits:
PingCheck
  • Object
show all
Defined in:
lib/is_it_working/checks/action_mailer_check.rb

Overview

Check if the mail server configured for ActionMailer is responding.

The ActionMailer class that yields the configuration can be specified with the :class option. By default this will be ActionMailer::Base. You can also set a :timeout option for how long to wait for a response and an :alias option which will be the name reported back by the check (defaults to the ActionMailer class).

Example

IsItWorking::Handler.new do |h|
  h.check :action_mailer, :class => UserMailer
end

Instance Method Summary collapse

Methods inherited from PingCheck

#call, #ping

Constructor Details

#initialize(options = {}) ⇒ ActionMailerCheck

Returns a new instance of ActionMailerCheck.



17
18
19
20
21
22
23
# File 'lib/is_it_working/checks/action_mailer_check.rb', line 17

def initialize(options={})
  options = options.dup
  klass = options.delete(:class) || ActionMailer::Base
  options.merge!(:host => klass.smtp_settings[:address], :port => klass.smtp_settings[:port] || 'smtp')
  options[:alias] ||= klass.name
  super(options)
end