Class: Katello::ErrataMailer
- Inherits:
-
ApplicationMailer
- Object
- ApplicationMailer
- Katello::ErrataMailer
- Defined in:
- app/mailers/katello/errata_mailer.rb
Instance Method Summary collapse
Instance Method Details
#host_errata(options) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'app/mailers/katello/errata_mailer.rb', line 5 def host_errata() user = ::User.find([:user]) ::User.as(user.login) do @hosts = ::Host::Managed.("view_hosts").reject do |host| !host.content_facet || host.content_facet.applicable_errata.empty? end set_locale_for(user) do mail(:to => user.mail, :subject => _("Host Errata Advisory")) end end end |
#promote_errata(options) ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'app/mailers/katello/errata_mailer.rb', line 31 def promote_errata() user = [:user] ::User.as(user.login) do @content_view = [:content_view] @environment = [:environment] @content_facets = Katello::Host::ContentFacet.with_content_views(@content_view).with_environments(@environment) @hosts = ::Host::Managed.("view_hosts").where(:id => @content_facets.pluck(:host_id)) @errata = @content_facets.map(&:installable_errata).flatten.uniq set_locale_for(user) do mail(:to => user.mail, :subject => (_("Promotion Summary for %{content_view}") % {:content_view => @content_view.name})) end end end |
#sync_errata(options) ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'app/mailers/katello/errata_mailer.rb', line 18 def sync_errata() user = [:user] all_errata = [:errata] @repo = [:repo] @errata_counts = errata_counts(all_errata) @errata = all_errata.take(100).group_by(&:errata_type) set_locale_for(user) do mail(:to => user.mail, :subject => (_("Sync Summary for %s") % @repo.name)) end end |