Created
June 22, 2015 19:56
-
-
Save daltonrenaldo/5d8141235d1ea81946bf to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env ./script/runner | |
| class AbandonedCartsReport | |
| def self.execute! | |
| new_carts = AbandonedCart.to_csv | |
| filename = "#{Rails.root}/tmp/abandoned_carts_report.csv" | |
| File.open(filename, "w") do |file| | |
| file.write(new_carts) | |
| end | |
| AdminMailer.deliver_attachments("info@hedgeye.com", "operations@hedgeye.com", "Abandoned Carts Report", [filename]) | |
| end | |
| end | |
| AbandonedCartsReport.execute! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment