Skip to content

Commit d8d17d1

Browse files
author
Tom Copeland
committed
Adding new users to daily email summary
1 parent 8a01551 commit d8d17d1

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

Diff for: app/models/daily_report.rb

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,12 @@ def summary_for(date)
77
datetime = date.to_datetime
88
beginning_of_date_integer = datetime.beginning_of_day.to_time.to_i
99
end_of_day_integer = datetime.end_of_day.to_time.to_i
10+
todays_users = User.find(:all, :conditions => {:add_date => beginning_of_date_integer..end_of_day_integer})
1011
todays_groups = Group.find(:all, :conditions => {:register_time => beginning_of_date_integer..end_of_day_integer})
1112
todays_forum_messages = Forum.find(:all, :conditions => {:post_date => beginning_of_date_integer..end_of_day_integer}).reject {|m| m.posted_by.user_id == 102}
1213
todays_opened_artifacts = Artifact.find(:all, :conditions => {:open_date => beginning_of_date_integer..end_of_day_integer})
1314
todays_released_files = FrsFile.find(:all, :conditions => {:post_date => beginning_of_date_integer..end_of_day_integer})
14-
body :date => date, :todays_groups => todays_groups, :todays_forum_messages => todays_forum_messages, :todays_opened_artifacts => todays_opened_artifacts, :todays_released_files => todays_released_files
15+
body :date => date, :todays_users => todays_users, :todays_groups => todays_groups, :todays_forum_messages => todays_forum_messages, :todays_opened_artifacts => todays_opened_artifacts, :todays_released_files => todays_released_files
1516
end
1617

1718
end

Diff for: app/views/daily_report/summary_for.html.erb

+5
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@ Hello there -
22

33
This is the daily report for <%= @date.to_s(:db) %>.
44

5+
The following <%= @todays_users.size %> users signed up today:
6+
<% @todays_users.each do |u| -%>
7+
<%= u.realname -%> (<%= u.user_name -%>, <%= u.email -%>)
8+
<% end -%>
9+
510
The following <%= @todays_groups.size %> projects were created today:
611
<% @todays_groups.each do |g| %>
712
<%= g.unix_group_name -%> (<%= truncate(g.short_description, 80) -%>) which is owned by <%= g.first_admin.user_name -%>

0 commit comments

Comments
 (0)