Merge pull request #3413 from LextrendIT/feature/notify_evaluation_comments
notify by email new evaluation comments
This commit is contained in:
@@ -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
|
||||
|
||||
16
app/models/evaluation_comment_notifier.rb
Normal file
16
app/models/evaluation_comment_notifier.rb
Normal 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
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user