邮件按天发送添加提示

This commit is contained in:
huang 2015-12-28 16:14:32 +08:00
parent af9bc9a124
commit 900d7d62cb
2 changed files with 6 additions and 2 deletions

View File

@ -156,7 +156,6 @@ class Mailer < ActionMailer::Base
def send_for_user_activities(user, date_to, days)
date_from = date_to - days.days
subject = "[ #{user.show_name}#{l(:label_day_mail)}]"
@subject = " #{user.show_name}#{l(:label_day_mail)}"
date_from = "#{date_from} 17:59:59"
date_to = "#{date_to} 17:59:59"
# 生成token用于直接点击登录
@ -268,7 +267,10 @@ class Mailer < ActionMailer::Base
has_content = [@issues,@issues_journals,@course_messages,@project_messages,@course_news,@course_news_comments,@project_news,@project_news_comments,@project_attachments,
@course_journal_messages,@user_journal_messages,@project_journal_messages,@forums,@memos,@attachments,@bids,@wiki_contents].any? {|o| !o.empty?}
total_count = @issues.count + @issues_journals.count + @course_messages.count + @project_messages.count + @course_news.count + @course_news_comments.count + @project_news.count + @project_news_comments.count +
@project_attachments.count + @course_journal_messages.count + @user_journal_messages.count + @project_journal_messages.count + @forums.count + @memos.count + @attachments.count +
@bids.count + @wiki_contents.count
@subject = " #{user.show_name}#{l(:label_day_mail_first)}#{total_count}#{l(:label_day_mail_last)}"
mylogger.debug "Sent activity mail : #{user.mail} - #{has_content}"
#有内容才发,没有不发
mail :to => user.mail,:subject => subject if has_content

View File

@ -110,6 +110,8 @@ zh:
label_week_mail: 一周动态
label_day_mail: 您好Trustie平台上与您相关的今日动态
label_day_mail_first: 您好!今天有
label_day_mail_last: 个动态与您相关Trustie让您更高效
#added by huang
field_tea_name: 教师
field_couurse_time: 学时