Merge pull request #3413 from LextrendIT/feature/notify_evaluation_comments

notify by email new evaluation comments
This commit is contained in:
Raimond Garcia
2019-06-06 11:29:38 +02:00
committed by GitHub
40 changed files with 319 additions and 54 deletions

View File

@@ -374,6 +374,12 @@ class Budget
milestones.published.with_status.order_by_publication_date.last&.status_id
end
def admin_and_valuator_users_associated
valuator_users = (valuator_groups.map(&:valuators) + valuators).flatten
all_users = valuator_users << administrator
all_users.compact.uniq
end
private
def set_denormalized_ids

View File

@@ -0,0 +1,16 @@
class EvaluationCommentNotifier
def initialize(args = {})
@comment = args.fetch(:comment)
end
def process
send_evaluation_comment_email
end
private
def send_evaluation_comment_email
EvaluationCommentEmail.new(@comment).to.each do |to|
Mailer.evaluation_comment(@comment, to).deliver_later
end
end
end

View File

@@ -93,6 +93,7 @@ class Setting < ApplicationRecord
"feature.allow_attached_documents": true,
"feature.allow_images": true,
"feature.help_page": true,
"feature.valuation_comment_notification": true,
"homepage.widgets.feeds.debates": true,
"homepage.widgets.feeds.processes": true,
"homepage.widgets.feeds.proposals": true,