fix mail cron send mail del log

This commit is contained in:
spen 2014-09-22 17:30:51 +08:00
parent 7e87b3c96b
commit a296b1d6e3
1 changed files with 8 additions and 3 deletions

View File

@ -63,7 +63,6 @@ class MailCronMailer < ActionMailer::Base
end
end
@mail_cron_log = {
:mail_subject => @data.mail_subject,
:mail_to => group_mail,
@ -74,10 +73,16 @@ class MailCronMailer < ActionMailer::Base
@mail_cron_log = MailCronLog.new(@mail_cron_log)
@mail_cron_log.save
@mail_to_count = @data.mail_to.split(',') - group_mail.split(',')
if @mail_to_count.count == 0
@data.destroy
else
@data.mail_to = @mail_to_count.join(',')
@data.save
end
end