Skip to content

Hates/spree_stock_email

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#SpreeStockEmail

Allow users to create notifications of when products are back in stock.

This extension has no views, you will have to add those yourself sadly. If the current user is logged in then emails will be created based on their current email address, otherwise they are prompted to enter one.

Here is a basic partial:

<% if spree_current_user %>
  <%= link_to stock_emails_path(stock_email: {product: @product.id}), method: :post do %>
      Notify me
  <% end %>
<% else %>
  <%= form_for :stock_email, url: stock_emails_path do |form| %>
    <%= form.hidden_field :product, value: @product.id %>
    <%= form.label :email, "Your email address" %>
    <%= form.text_field :email %>
    <%= button_tag class: 'button', type: :submit do %>
      Notify me
    <% end %>
  <% end %>
<% end %>

##Installation

Add spree_stock_email to your Gemfile:

gem 'spree_stock_email'

Bundle your dependencies and run the installation generator:

bundle
bundle exec rails g spree_stock_email:install

About

Receive emails when products are back in stock

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages