Skip to content

Commit

Permalink
Fix email config
Browse files Browse the repository at this point in the history
  • Loading branch information
jgreben committed Nov 16, 2023
1 parent efe413b commit ffd3aa4
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions tasks/download_report.rake
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,18 @@ task :mail do
delivery_method :smtp, options
end

file = File.read('files/credits.csv')

file.write('NO FILE') unless file.file?

mail = Mail.new do
from 'cardPaymentReporter@stanford.edu'
to ENV.fetch('EMAIL_REPORT_TO', 'sul-unicorn-devs@lists.stanford.edu')
subject "Card Payment Report #{Date.today.strftime('%m-%Y')}"
body File.read(file)
add_file file
begin
mail = Mail.new do
from 'cardPaymentReporter@stanford.edu'
to ENV.fetch('EMAIL_REPORT_TO', 'sul-unicorn-devs@lists.stanford.edu')
subject "Card Payment Report #{Date.today.strftime('%m-%Y')}"
body File.read('files/credits.csv')
add_file 'files/credits.csv'
end

mail.delivery_method :sendmail
mail.deliver
rescue Errno::ENOENT => e
puts e
end

mail.delivery_method :sendmail
mail.deliver
end

0 comments on commit ffd3aa4

Please sign in to comment.