Class: ErrorMailer

Inherits:
ActionMailer::Base
  • Object
show all
Defined in:
lib/smklib/error_mailer.rb

Instance Method Summary collapse

Instance Method Details

#snapshot(rcpt, from, exception, trace, p_session, p_params, p_env, sent_on = Time.now) ⇒ Object



51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# File 'lib/smklib/error_mailer.rb', line 51

def snapshot(rcpt, from, exception, trace, p_session, p_params, p_env, sent_on = Time.now)
	@recipients         = rcpt
	@from               = from
	if exception.class.to_s == "ActionController::UnknownAction"
    @subject            = "[NotFound] #{exception.class.to_s} in #{p_env['REQUEST_URI']}" 
	else
    @subject            = "[Error] #{exception.class.to_s} in #{p_env['REQUEST_URI']}" 
	end
	@sent_on            = sent_on
	@body["v_exception"]  = exception
	@body["v_trace"]      = trace
	@body["v_session"]    = p_session
	@body["v_params"]      = p_params
	@body["v_env"]        = p_env
	content_type "text/html"
end