now approvers for the category only get the emails

This commit is contained in:
Harry Bomrah 2016-08-30 15:18:42 +08:00
parent 3f9446d545
commit 2f0f080687
1 changed files with 3 additions and 2 deletions

View File

@ -147,8 +147,9 @@ module Admin::AnnouncementsHelper
users = users.concat(admins.to_a)
end
if @announcement_setting.email_to.include?("approvers")
approvers = User.find(@announcement_setting.approvers) rescue []
users = users.concat(approvers.to_a)
approvers = User.find(@announcement_setting.approvers).to_a rescue []
auths = Authorization.where(:category_id => announcement.category_id).collect{|a| a.user}
users = users.concat(approvers & auths)
end
users.each do |user|
email = user.member_profile.email