Sha256: 369060a76eb7634f6cc860e7b8727ad915079fb629f3b488b7cb7ed9d95e83ef

Contents?: true

Size: 390 Bytes

Versions: 11

Compression:

Stored size: 390 Bytes

Contents

class RexJobMailer < ApplicationMailer
  add_template_helper(ApplicationHelper)

  def job_finished(job, opts = {})
    @job = job
    @subject = opts[:subject] || _('REX job has finished - %s') % @job.to_s

    if @job.user.nil?
      Rails.logger.warn 'Job user no longer exist, skipping email notification'
      return
    end

    mail(to: @job.user.mail, subject: @subject)
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
foreman_remote_execution-5.0.8 app/mailers/rex_job_mailer.rb
foreman_remote_execution-5.0.7 app/mailers/rex_job_mailer.rb
foreman_remote_execution-5.0.6 app/mailers/rex_job_mailer.rb
foreman_remote_execution-5.0.5 app/mailers/rex_job_mailer.rb
foreman_remote_execution-5.0.4 app/mailers/rex_job_mailer.rb
foreman_remote_execution-5.0.3 app/mailers/rex_job_mailer.rb
foreman_remote_execution-5.0.2 app/mailers/rex_job_mailer.rb
foreman_remote_execution-5.1.0 app/mailers/rex_job_mailer.rb
foreman_remote_execution-5.0.1 app/mailers/rex_job_mailer.rb
foreman_remote_execution-5.0.0 app/mailers/rex_job_mailer.rb
foreman_remote_execution-4.8.0 app/mailers/rex_job_mailer.rb