diff --git a/app/models/mailer.rb b/app/models/mailer.rb index d35374fcf..a834ddb14 100644 --- a/app/models/mailer.rb +++ b/app/models/mailer.rb @@ -166,7 +166,7 @@ class Mailer < ActionMailer::Base @course_journal_messages,@user_journal_messages,@forums,@memos,@attachments,@bids].any? {|o| !o.empty? } - binding.pry if Rails.env.development? + mylogger.debug "Sent activity mail : #{user.mail} - #{has_content}" #有内容才发,没有不发 mail :to => user.mail,:subject => subject if has_content end @@ -841,11 +841,12 @@ class Mailer < ActionMailer::Base end set_language_if_valid @initial_language - super headers do |format| + m = super headers do |format| format.text format.html unless Setting.plain_text_mail? end - + mylogger.debug "Sent a mail from #{m.from} to [#{m.to},#{m.cc}, #{m.bcc if Setting.bcc_recipients?}] subject: #{m.subject}" + m end def initialize(*args) @@ -900,7 +901,11 @@ class Mailer < ActionMailer::Base end def mylogger - Rails.logger + if Setting.delayjob_enabled? + Delayed::Worker.logger + else + Rails.logger + end end def add_attachments(obj)