{"id":23765801,"url":"https://github.com/solidusio-contrib/solidus_abandoned_carts","last_synced_at":"2025-09-05T09:33:03.891Z","repository":{"id":38356790,"uuid":"140761920","full_name":"solidusio-contrib/solidus_abandoned_carts","owner":"solidusio-contrib","description":"🛒 Manage abandoned carts in Solidus","archived":false,"fork":false,"pushed_at":"2023-07-08T23:48:45.000Z","size":87,"stargazers_count":12,"open_issues_count":1,"forks_count":11,"subscribers_count":10,"default_branch":"master","last_synced_at":"2024-12-20T14:33:01.923Z","etag":null,"topics":["abandoned-cart","ecommerce","extension","solidus","solidus-extensions"],"latest_commit_sha":null,"homepage":"","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/solidusio-contrib.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":"2018-07-12T20:32:00.000Z","updated_at":"2024-07-25T18:21:05.000Z","dependencies_parsed_at":"2022-08-25T05:01:16.666Z","dependency_job_id":null,"html_url":"https://github.com/solidusio-contrib/solidus_abandoned_carts","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solidusio-contrib%2Fsolidus_abandoned_carts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solidusio-contrib%2Fsolidus_abandoned_carts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solidusio-contrib%2Fsolidus_abandoned_carts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solidusio-contrib%2Fsolidus_abandoned_carts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/solidusio-contrib","download_url":"https://codeload.github.com/solidusio-contrib/solidus_abandoned_carts/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":232034914,"owners_count":18463363,"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":["abandoned-cart","ecommerce","extension","solidus","solidus-extensions"],"created_at":"2024-12-31T23:17:53.362Z","updated_at":"2024-12-31T23:17:54.237Z","avatar_url":"https://github.com/solidusio-contrib.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SolidusAbandonedCarts\n\n[![CircleCI](https://circleci.com/gh/solidusio-contrib/solidus_abandoned_carts.svg?style=svg)](https://circleci.com/gh/solidusio-contrib/solidus_abandoned_carts)\n\nTake action on your abandoned carts!\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'solidus_abandoned_carts', github: 'solidusio-contrib/solidus_abandoned_carts'\n```\n\nThen run the following:\n\n```console\n$ bundle install\n$ bundle exec rails g solidus_abandoned_carts:install\n```\n\nIf you want to change the configuration, you can add the following to an initializer:\n\n```ruby\nSolidusAbandonedCarts::Config.tap do |config|\n  # Amount of time after which a cart is considered abandoned.\n  config.abandoned_timeout = 24.hours\n\n  # The states in which a cart is considered to be abandoned.\n  config.abandoned_states = [:cart, :address, :delivery, :payment, :confirm]\n\n  # Set your own notifier class\n  config.notifier_class = 'Spree::AbandonedCartNotifier'\n\n  # Set your own mailer class\n  config.mailer_class = 'Spree::AbandonedCartMailer'\n\n  # Set your own notifier job class\n  config.notifier_job_class = 'Spree::NotifyAbandonedCartJob'\n\n  # Set your own schedule job class\n  config.schedule_job_class = 'Spree::ScheduleAbandonedCartsJob'\nend\n```\n\nThe last step in the installation process is to configure the `Spree::ScheduleAbandonedCartsJob`\nbackground job to run regularly. There are different ways to do this depending on the environment\nyour application is running in: Heroku Scheduler, cron etc.\n\n## Usage\n\nIf you're okay with the default behavior of sending an abandoned cart email, you can simply override\nthe `spree.abandoned_cart_subject` translation key and the `spree/abandoned_cart_mailer/abandoned_cart_email.html.erb`\nview. The default notifier will take care of sending the email for you.\n\nIf, on the other hand, you want to use custom logic, keep reading!\n\n### Custom notifier\n\nYou can define your own abandoned cart logic by changing the `notifier_class` configuration\nparameter. Here's what an example notifier could look like, if you wanted to call an external API\ninstead of sending an email:\n\n```ruby\nmodule AwesomeStore\n  class AbandonedCartNotifier \u003c Spree::AbandonedCartNotifier\n    def call\n      # Skip notification if this cart was already notified\n      return if order.abandoned_cart_email_sent_at\n\n      # Run your custom logic\n      MyApiService.notify_abandoned_cart(order.email)\n\n      # Mark this cart as notified\n      order.touch :abandoned_cart_email_sent_at\n    end\n  end\nend\n```\n\n## Testing\n\nRun the following to automatically build a dummy app and run the tests:\n\n```console\n$ bundle exec rake\n```\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/solidusio-contrib/solidus_abandoned_carts.\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsolidusio-contrib%2Fsolidus_abandoned_carts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsolidusio-contrib%2Fsolidus_abandoned_carts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsolidusio-contrib%2Fsolidus_abandoned_carts/lists"}