From bcd5803c6071113d8b9bc751a8eaa62fa534e6ce Mon Sep 17 00:00:00 2001 From: slawa Date: Fri, 1 Aug 2014 17:44:49 +0300 Subject: [PATCH] Extract all meeting participants and send email using a loop to avoid specify BCC option --- app/controllers/meeting_contents_controller.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/controllers/meeting_contents_controller.rb b/app/controllers/meeting_contents_controller.rb index 94a7991022..b2c00e7d12 100644 --- a/app/controllers/meeting_contents_controller.rb +++ b/app/controllers/meeting_contents_controller.rb @@ -83,7 +83,11 @@ class MeetingContentsController < ApplicationController def notify unless @content.new_record? - MeetingMailer.content_for_review(@content, @content_type).deliver + recipients = @content.meeting.participants.collect{|p| p.mail}.reject{|r| r == @content.meeting.author.mail} + recipients << @content.meeting.author.mail if @content.meeting.author.preference[:no_self_notified] + recipients.each do |recipient| + MeetingMailer.content_for_review(@content, @content_type, recipient).deliver + end flash[:notice] = l(:notice_successful_notification) end redirect_back_or_default :controller => '/meetings', :action => 'show', :id => @meeting