Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Emails are not sent to the author if no_self_notified #1570

Merged
merged 2 commits into from
Dec 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions app/models/dmsf_mailer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,19 @@ def workflow_notification(user, workflow, revision, subject_id, text1_id, text2_
@notice = notice
@author = revision.dmsf_workflow_assigned_by_user
@author ||= User.anonymous
mail to: user,
subject:
"[#{@project.name} - #{l(:field_label_dmsf_workflow)}] #{@workflow.name} #{l(subject_id)} #{step_name}"
skip_no_self_notified = false
begin
# We need to switch off no_self_notified temporarily otherwise the email won't be sent
if (@author == user) && @author.pref.no_self_notified
@author.pref.no_self_notified = false
skip_no_self_notified = true
end
mail to: user,
subject:
"[#{@project.name} - #{l(:field_label_dmsf_workflow)}] #{@workflow.name} #{l(subject_id)} #{step_name}"
ensure
@author.pref.no_self_notified = true if skip_no_self_notified
end
end

# force_notification = true => approval workflow's notifications
Expand Down
Loading