Skip to content

Commit

Permalink
Email notifications for workflow are not sent #1394
Browse files Browse the repository at this point in the history
  • Loading branch information
picman committed Aug 19, 2022
1 parent 08e22a4 commit a8e3ade
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions app/controllers/dmsf_workflows_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def new_action
end
if revision.workflow == DmsfWorkflow::STATE_APPROVED
# Just approved
if Setting.notified_events.include?('dmsf_workflow_action')
if Setting.notified_events.include?('dmsf_workflow_plural')
recipients = DmsfMailer.get_notify_users(@project, revision.dmsf_file, true)
DmsfMailer.deliver_workflow_notification(
recipients,
Expand All @@ -97,7 +97,7 @@ def new_action
end
else
# Just rejected
if Setting.notified_events.include?('dmsf_workflow_action')
if Setting.notified_events.include?('dmsf_workflow_plural')
recipients = @dmsf_workflow.participiants
recipients.push revision.dmsf_workflow_assigned_by_user
recipients.uniq!
Expand All @@ -122,7 +122,7 @@ def new_action
else
if action.action == DmsfWorkflowStepAction::ACTION_DELEGATE
# Delegation
if Setting.notified_events.include?('dmsf_workflow_action')
if Setting.notified_events.include?('dmsf_workflow_plural')
delegate = User.active.find_by(id: params[:step_action].to_i / 10)
if DmsfMailer.get_notify_users(@project, revision.dmsf_file, true).include?(delegate)
DmsfMailer.deliver_workflow_notification(
Expand All @@ -143,7 +143,7 @@ def new_action
# Next step
assignments = @dmsf_workflow.next_assignments revision.id
unless assignments.empty?
if Setting.notified_events.include?('dmsf_workflow_action')
if Setting.notified_events.include?('dmsf_workflow_plural')
if assignments.first.dmsf_workflow_step.step != action.dmsf_workflow_step_assignment.dmsf_workflow_step.step
# Next step
assignments.each do |assignment|
Expand Down Expand Up @@ -426,7 +426,7 @@ def start
if revision
revision.set_workflow(@dmsf_workflow.id, params[:action])
if revision.save
if Setting.notified_events.include?('dmsf_workflow_action')
if Setting.notified_events.include?('dmsf_workflow_plural')
@dmsf_workflow.notify_users(@project, revision, self)
end
flash[:notice] = l(:notice_workflow_started)
Expand Down

0 comments on commit a8e3ade

Please sign in to comment.