Class: ClarkKent::ReportMailer
- Inherits:
-
ActionMailer::Base
- Object
- ActionMailer::Base
- ClarkKent::ReportMailer
- Defined in:
- app/mailers/clark_kent/report_mailer.rb
Instance Method Summary collapse
- #report_error(report_id, user_id, error_message) ⇒ Object
- #report_run(report_id, user_id, report_accessor) ⇒ Object
Instance Method Details
#report_error(report_id, user_id, error_message) ⇒ Object
18 19 20 21 22 23 24 25 |
# File 'app/mailers/clark_kent/report_mailer.rb', line 18 def report_error(report_id, user_id, ) @report = Report.find(report_id) @user = ::User.find(user_id) @recipient_email = @user.email @error_message = @subject = "Your report #{@report.name} has a problem" mail(to: @recipient_email, subject: @subject) end |
#report_run(report_id, user_id, report_accessor) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'app/mailers/clark_kent/report_mailer.rb', line 5 def report_run(report_id, user_id, report_accessor) @report = Report.find(report_id) @user = ::User.find(user_id) @recipient_email = @user.email if 'login_required' == ClarkKent.email_security @report_filename = report_accessor else @report_download_url = report_accessor end @subject = "Your report #{@report.name} is ready" mail(to: @recipient_email, subject: @subject) end |