diff --git a/app/lib/actions/katello/capsule_content/sync.rb b/app/lib/actions/katello/capsule_content/sync.rb index 88b8813ac36..ee283827e85 100644 --- a/app/lib/actions/katello/capsule_content/sync.rb +++ b/app/lib/actions/katello/capsule_content/sync.rb @@ -52,7 +52,7 @@ def notify_on_failure(_plan) notification = MailNotification[:proxy_sync_failure] proxy = SmartProxy.find(input.fetch(:smart_proxy, {})[:id]) subjects = subjects(input[:options]).merge(smart_proxy: proxy) - notification.users.where(disabled: [nil, false], mail_enabled: true).each do |user| + notification.users.with_enabled_email.each do |user| notification.deliver(subjects.merge(user: user, task: task)) end end diff --git a/app/lib/actions/katello/content_view/promote.rb b/app/lib/actions/katello/content_view/promote.rb index cdfaccd2f69..a8162179a16 100644 --- a/app/lib/actions/katello/content_view/promote.rb +++ b/app/lib/actions/katello/content_view/promote.rb @@ -27,7 +27,7 @@ def plan(version, environments, is_force = false, description = nil, incremental def notify_on_failure(_plan) notification = MailNotification[:content_view_promote_failure] view = ::Katello::ContentView.find(input.fetch(:content_view, {})[:id]) - notification.users.where(disabled: [nil, false], mail_enabled: true).each do |user| + notification.users.with_enabled_email.each do |user| notification.deliver(user: user, content_view: view, task: task) end end diff --git a/app/lib/actions/katello/content_view/publish.rb b/app/lib/actions/katello/content_view/publish.rb index d0257a6690e..cf3969dc74f 100644 --- a/app/lib/actions/katello/content_view/publish.rb +++ b/app/lib/actions/katello/content_view/publish.rb @@ -136,7 +136,7 @@ def trigger_capsule_sync(_execution_plan) def notify_on_failure(_plan) notification = MailNotification[:content_view_publish_failure] view = ::Katello::ContentView.find(input.fetch(:content_view, {})[:id]) - notification.users.where(disabled: [nil, false], mail_enabled: true).each do |user| + notification.users.with_enabled_email.each do |user| notification.deliver(user: user, content_view: view, task: task) end end diff --git a/app/lib/actions/katello/repository/sync.rb b/app/lib/actions/katello/repository/sync.rb index c5686b2af82..6ff1384e139 100644 --- a/app/lib/actions/katello/repository/sync.rb +++ b/app/lib/actions/katello/repository/sync.rb @@ -100,7 +100,7 @@ def rescue_strategy def notify_on_failure(_plan) notification = MailNotification[:repository_sync_failure] repo = ::Katello::Repository.find(input.fetch(:repository, {})[:id]) - notification.users.where(disabled: [nil, false], mail_enabled: true).each do |user| + notification.users.with_enabled_email.each do |user| notification.deliver(user: user, repo: repo, task: task) end end diff --git a/lib/katello/plugin.rb b/lib/katello/plugin.rb index 9f5099c1620..3ab49ecd176 100644 --- a/lib/katello/plugin.rb +++ b/lib/katello/plugin.rb @@ -4,7 +4,7 @@ # rubocop:disable Metrics/BlockLength Foreman::Plugin.register :katello do - requires_foreman '>= 3.7' + requires_foreman '>= 3.11' register_gettext sub_menu :top_menu, :content_menu, :caption => N_('Content'),