https://github.com/madetech/spree_abandoned_orders
https://github.com/madetech/spree_abandoned_orders
Last synced: 29 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/madetech/spree_abandoned_orders
- Owner: madetech
- License: mit
- Created: 2016-06-13T12:50:21.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2016-06-29T21:08:20.000Z (almost 10 years ago)
- Last Synced: 2025-01-25T14:11:44.069Z (over 1 year ago)
- Language: Ruby
- Size: 36.1 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Abandoned Orders For Spree
[](https://codeclimate.com/github/madetech/spree_abandoned_orders) [](https://travis-ci.org/madetech/spree_abandoned_orders) [](https://codeclimate.com/github/madetech/spree_abandoned_orders/coverage)
An abandoned order extension for Spree, which looks for orders with line items that were created between X & Y days ago and sends an email notification to the customer to remind them to purchase.
Originally this gem was forked from [https://github.com/Hates/spree_abandoned_cart_email](https://github.com/Hates/spree_abandoned_cart_email) but we subsequently decided to rewrite the functionality to make it more modular and reusable across multiple applications.
##Installation
Add spree_abandoned_orders to your Gemfile:
```ruby
gem 'spree_abandoned_orders'
```
Bundle your dependencies and run the installation generator:
```ruby
bundle install
bundle exec rails g spree_abandoned_orders:install
bundle exec rake db:migrate
```
Use the config values below to change settings:
```ruby
Spree::AbandonedOrdersConfig.inactive_for = 12.hours
Spree::AbandonedOrdersConfig.ignore_after = 5.days
```
Override the email view to customise:
```ruby
app/views/spree/abandoned_order_mailer/abandoned_email.html.erb
```
Create a rake task to send the email:
```ruby
desc "Abandoned order email"
task send_abandoned_order_notifications: :environment do
abandoned_orders = Spree::AbandonedOrders::LookupQuery.new.find_each
Spree::AbandonedOrders::FilterNotifiedQuery.new(abandoned_orders).find_each.each do |order|
Spree::AbandonedOrders::Notifier.new(order).save
end
end
```
##Testing
To run the tests, create a dummy Rails application and run the suite.
```ruby
bundle
bundle exec rake test_app
bundle exec rspec spec
```
## Credits

Developed and maintained by [Made Tech Ltd](https://www.madetech.com/). Key contributions:
* [Nick Wood](https://github.com/SebAshton)
* [Rory MacDonald](https://github.com/rorymacdonald)
* [Andrew Scott](https://github.com/askl56)
## License
Copyright © 2016 [Made Tech Ltd](https://www.madetech.com/). It is free software, and may be redistributed under the terms specified in the MIT-LICENSE file.