Class: SpotlightSearch::ExportMailer

Inherits:
ActionMailer::Base
  • Object
show all
Defined in:
app/mailers/spotlight_search/export_mailer.rb

Instance Method Summary collapse

Instance Method Details

#send_error_message(email, err) ⇒ Object



10
11
12
13
14
# File 'app/mailers/spotlight_search/export_mailer.rb', line 10

def send_error_message(email, err)
  @error_message = err.message
  mail(to: email, subject: "Error generating CSV file")
  Rollbar.error(err)
end

#send_excel_file(email, file_path, subject) ⇒ Object



5
6
7
8
# File 'app/mailers/spotlight_search/export_mailer.rb', line 5

def send_excel_file(email, file_path, subject)
  attachments[file_path.split('/').last] = File.read(file_path)
  mail(to: email, subject: subject)
end