Emails are not sent to the author if no_self_notified

This commit is contained in:
Hunt Redmine 2024-12-05 18:38:17 +08:00 committed by uhuntu
parent 832ec06ba3
commit a80f9b8927

View File

@ -158,9 +158,19 @@ class DmsfMailer < Mailer
@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