Merge branch 'guange_dev' into szzh
This commit is contained in:
commit
4088d134df
|
@ -166,7 +166,7 @@ class Mailer < ActionMailer::Base
|
||||||
@course_journal_messages,@user_journal_messages,@forums,@memos,@attachments,@bids].any? {|o|
|
@course_journal_messages,@user_journal_messages,@forums,@memos,@attachments,@bids].any? {|o|
|
||||||
!o.empty?
|
!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
|
mail :to => user.mail,:subject => subject if has_content
|
||||||
end
|
end
|
||||||
|
@ -841,11 +841,12 @@ class Mailer < ActionMailer::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
set_language_if_valid @initial_language
|
set_language_if_valid @initial_language
|
||||||
super headers do |format|
|
m = super headers do |format|
|
||||||
format.text
|
format.text
|
||||||
format.html unless Setting.plain_text_mail?
|
format.html unless Setting.plain_text_mail?
|
||||||
end
|
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
|
end
|
||||||
|
|
||||||
def initialize(*args)
|
def initialize(*args)
|
||||||
|
@ -900,7 +901,11 @@ class Mailer < ActionMailer::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
def mylogger
|
def mylogger
|
||||||
Rails.logger
|
if Setting.delayjob_enabled?
|
||||||
|
Delayed::Worker.logger
|
||||||
|
else
|
||||||
|
Rails.logger
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def add_attachments(obj)
|
def add_attachments(obj)
|
||||||
|
|
Loading…
Reference in New Issue