Permalink
Browse files

fixed mailer

  • Loading branch information...
1 parent 4b25b73 commit f6bbdda55942419a5e62f6bb1d80c86ea0840489 @mkristian committed Mar 18, 2011
Showing with 6 additions and 6 deletions.
  1. +4 −4 lib/ixtlan/errors/error_dumper.rb
  2. +1 −1 lib/ixtlan/errors/mailer.rb
  3. +1 −1 lib/ixtlan/errors/railtie.rb
@@ -15,16 +15,16 @@ def keep_dumps=(ttl)
end
def dump_dir
- unless @dump_dir
+ if @dump_dir.blank?
@dump_dir = File.join(Rails.root, "log", "errors")
FileUtils.mkdir_p(@dump_dir)
end
@dump_dir
end
- def dump_dir=(dr)
+ def dump_dir=(dir)
@dump_dir = dir
- FileUtils.mkdir_p(@dump_dir) if dir
+ FileUtils.mkdir_p(@dump_dir) unless dir.blank?
@dump_dir
end
@@ -34,7 +34,7 @@ def dump(controller, exception)
logger = Logger.new(log_file)
dump_environment(logger, exception, controller)
- Mailer.deliver_error_notification(@email_from, @email_to, exception, log_file) unless (@email_to.blank? || @email_from.blank?)
+ Mailer.error_notification(@email_from, @email_to, exception, log_file).deliver unless (@email_to.blank? || @email_from.blank?)
log_file
end
@@ -4,7 +4,7 @@ class Mailer < ActionMailer::Base
def error_notification(email_from, emails_to, exception, error_file)
@subject = exception.message
- @body = {:text => "#{error_file}"}
+ @text = "#{error_file}"
@recipients = emails_to
@from = email_from
@sent_on = Time.now
@@ -9,7 +9,7 @@ class Railtie < Rails::Railtie
config.before_configuration do |app|
- path = File.join(File.dirname(__FILE__), "mailer")
+ path = File.join(File.dirname(__FILE__), "..", "..")
unless ActionMailer::Base.view_paths.member? path
ActionMailer::Base.view_paths= [ActionMailer::Base.view_paths, path].flatten
end

0 comments on commit f6bbdda

Please sign in to comment.