Sha256: a9b091a0264ea3ef568c542f81fe198ff04a138dc09ed0e9fa1001736e469a2b

Contents?: true

Size: 826 Bytes

Versions: 18

Compression:

Stored size: 826 Bytes

Contents

module Katello
  class SubscriptionMailer < ApplicationMailer
    helper :'katello/subscription_mailer'
    after_action :prevent_sending_blank_report
    include SubscriptionMailerHelper

    def subscription_expiry(options)
      user = ::User.find(options[:user])
      days_from_now = options[:query]

      ::User.as(user.login) do
        @pools = Katello::Pool.readable.expiring_in_days(days_from_now)
      end

      start_report_task(days_from_now)
      @report_url = report_url
      @report_link = report_link

      set_locale_for(user) do
        mail(:to => user.mail, :subject => _("You have subscriptions expiring within %s days") % days_from_now)
      end
    end

    private

    def prevent_sending_blank_report
      if @pools.blank?
        mail.perform_deliveries = false
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
katello-4.16.0 app/mailers/katello/subscription_mailer.rb
katello-4.15.1 app/mailers/katello/subscription_mailer.rb
katello-4.16.0.rc2 app/mailers/katello/subscription_mailer.rb
katello-4.16.0.rc1 app/mailers/katello/subscription_mailer.rb
katello-4.14.3 app/mailers/katello/subscription_mailer.rb
katello-4.14.2 app/mailers/katello/subscription_mailer.rb
katello-4.15.0 app/mailers/katello/subscription_mailer.rb
katello-4.15.0.rc2 app/mailers/katello/subscription_mailer.rb
katello-4.15.0.rc1 app/mailers/katello/subscription_mailer.rb
katello-4.14.1 app/mailers/katello/subscription_mailer.rb
katello-4.14.0 app/mailers/katello/subscription_mailer.rb
katello-4.14.0.rc3 app/mailers/katello/subscription_mailer.rb
katello-4.14.0.rc2 app/mailers/katello/subscription_mailer.rb
katello-4.14.0.rc1.1 app/mailers/katello/subscription_mailer.rb
katello-4.14.0.rc1 app/mailers/katello/subscription_mailer.rb
katello-4.13.1 app/mailers/katello/subscription_mailer.rb
katello-4.13.0 app/mailers/katello/subscription_mailer.rb
katello-4.13.0.rc1 app/mailers/katello/subscription_mailer.rb