summaryrefslogtreecommitdiffstats
path: root/app/models
diff options
context:
space:
mode:
authorMarius Balteanu <marius.balteanu@zitec.com>2024-04-28 06:40:12 +0000
committerMarius Balteanu <marius.balteanu@zitec.com>2024-04-28 06:40:12 +0000
commitb5c48c1d973c501de61e7cbd1b6f8ad9ac1f112d (patch)
tree203b7eefea0cd8aa4af4e1555e89a9ac4f03efdf /app/models
parente4fcfc6990a724cacd6d4e978ee051735769f180 (diff)
downloadredmine-b5c48c1d973c501de61e7cbd1b6f8ad9ac1f112d.tar.gz
redmine-b5c48c1d973c501de61e7cbd1b6f8ad9ac1f112d.zip
Adds an option to send email notification when an attachment is added (#40569).
Patch by Mizuki ISHIKAWA (#ishikawa999). git-svn-id: https://svn.redmine.org/redmine/trunk@22790 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models')
-rw-r--r--app/models/journal.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/models/journal.rb b/app/models/journal.rb
index 5468c8629..24c54544b 100644
--- a/app/models/journal.rb
+++ b/app/models/journal.rb
@@ -354,7 +354,8 @@ class Journal < ApplicationRecord
(Setting.notified_events.include?('issue_status_updated') && new_status.present?) ||
(Setting.notified_events.include?('issue_assigned_to_updated') && detail_for_attribute('assigned_to_id').present?) ||
(Setting.notified_events.include?('issue_priority_updated') && new_value_for('priority_id').present?) ||
- (Setting.notified_events.include?('issue_fixed_version_updated') && detail_for_attribute('fixed_version_id').present?)
+ (Setting.notified_events.include?('issue_fixed_version_updated') && detail_for_attribute('fixed_version_id').present?) ||
+ (Setting.notified_events.include?('issue_attachment_added') && details.any? {|d| d.property == 'attachment' && d.value })
)
Mailer.deliver_issue_edit(self)
end