Sha256: 9ce177ba0a367685b3bb61ce91595b8fe906c2d1a63b86e073ba1c29faf50d97

Contents?: true

Size: 509 Bytes

Versions: 8

Compression:

Stored size: 509 Bytes

Contents

module SpotlightSearch
  class ExportMailer < ActionMailer::Base
    default from: "no-reply@#{Rails.application.config.action_mailer.default_url_options[:host]}"

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

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

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
spotlight_search-0.3.4 app/mailers/spotlight_search/export_mailer.rb
spotlight_search-0.3.3 app/mailers/spotlight_search/export_mailer.rb
spotlight_search-0.3.2 app/mailers/spotlight_search/export_mailer.rb
spotlight_search-0.3.1 app/mailers/spotlight_search/export_mailer.rb
spotlight_search-0.3.0 app/mailers/spotlight_search/export_mailer.rb
spotlight_search-0.2.2 app/mailers/spotlight_search/export_mailer.rb
spotlight_search-0.2.1 app/mailers/spotlight_search/export_mailer.rb
spotlight_search-0.2.0 app/mailers/spotlight_search/export_mailer.rb