{"id":21696437,"url":"https://github.com/madetech/order_reporting","last_synced_at":"2025-03-20T14:48:07.692Z","repository":{"id":59156088,"uuid":"62641808","full_name":"madetech/order_reporting","owner":"madetech","description":null,"archived":false,"fork":false,"pushed_at":"2016-07-09T10:12:58.000Z","size":59,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":49,"default_branch":"master","last_synced_at":"2024-04-24T23:22:08.450Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/madetech.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-07-05T14:07:11.000Z","updated_at":"2024-04-24T23:22:08.451Z","dependencies_parsed_at":"2022-09-13T20:11:31.819Z","dependency_job_id":null,"html_url":"https://github.com/madetech/order_reporting","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/madetech%2Forder_reporting","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/madetech%2Forder_reporting/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/madetech%2Forder_reporting/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/madetech%2Forder_reporting/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/madetech","download_url":"https://codeload.github.com/madetech/order_reporting/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244636016,"owners_count":20485441,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-25T19:19:52.726Z","updated_at":"2025-03-20T14:48:07.668Z","avatar_url":"https://github.com/madetech.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Order Reporting for Spree and Solidus\n\n[![Build Status](https://travis-ci.org/madetech/order_reporting.svg?branch=master)](https://travis-ci.org/madetech/order_reporting)\n\nAutomatically sends lists of orders via email based on criteria.\n\n## Installing in Spree app\n\nAdd this to your Gemfile:\n\n```\ngem 'spree_order_reporting'\n```\n\n## Installing in Solidus app\n\nAdd this to your Gemfile:\n\n```\ngem 'solidus_order_reporting'\n```\n\n## Setup\n\nThree steps to configure:\n\n1. Create mailer and template\n2. Create query object for selecting orders\n3. Setup gem with initializer\n\n### 1. Create mailer and template\n\n```ruby\nclass OrderReportMailer \u003c ActionMailer::Base\n  def exported_orders(orders)\n    @orders = orders\n    mail(to: 'cs@shop.com', subject: 'Exported Orders')\n  end\nend\n```\n\n### 2. Create query object for selecting orders\n\n```ruby\nclass ExportedOrdersQuery\n  def orders\n    Spree::Order.exported.where('completed_at \u003e ?', 24.hours.ago)\n  end\nend\n```\n\n### 3. Setup gem with initializer\n\nCreate an application initializer in `config/initializers/order_reporting.rb`:\n\n``` ruby\nOrderReporting.mailer_class = OrderReportMailer\nOrderReporting.scheduler = OrderReporting::DelayedJobScheduler.new\n\nOrderReporting.define_report :exported_orders do |config|\n  config.send_every = 24.hours\n  config.query = ExportedOrdersQuery.new\nend\n```\n\n## Development\n\nRun spree tests:\n\n```\nrm -rf spec/dummy/\nBUNDLE_GEMFILE=Gemfile.spree.rb bundle\nBUNDLE_GEMFILE=Gemfile.spree.rb bundle exec rake\n```\n\nRun solidus tests:\n\n```\nrm -rf spec/dummy/\nBUNDLE_GEMFILE=Gemfile.solidus.rb bundle\nBUNDLE_GEMFILE=Gemfile.solidus.rb bundle exec rake\n```\n\n## Publishing\n\nBefore publishing you will need to have created a new release. To do so update `lib/order_reporting/version.rb` to new version number and commit this change as \"New release vx.x.x\". Then tag this commit with ```git tag vx.x.x``` and push it `git push origin vx.x.x`. Then you need to publish to RubyGems...\n\nPublish Spree gem:\n\n```\ngem build spree_order_reporting.gemspec\ngem push spree_order_reporting-x.x.x.gem\n```\n\nPublish Solidus gem:\n\n```\ngem build solidus_order_reporting.gemspec\ngem push solidus_order_reporting-x.x.x.gem\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmadetech%2Forder_reporting","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmadetech%2Forder_reporting","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmadetech%2Forder_reporting/lists"}