Skip to content

Commit

Permalink
Improve Solidus events documentantion
Browse files Browse the repository at this point in the history
Solidus internal events were not showing properly.
  • Loading branch information
spaghetticode committed Oct 30, 2020
1 parent bcef2ea commit 2aac8ee
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions guides/source/developers/events/overview.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@ confirmation emails when an order is finalized, or again to send emails
when an order is refunded successfully.

Currently, the events fired by default in Solidus are:
* `order_finalized`
* `order_recalculated`
* `reimbursement_reimbursed`
* `reimbursement_errored`

* `order_finalized`
* `order_recalculated`
* `reimbursement_reimbursed`
* `reimbursement_errored`

Events make extending Solidus with custom behavior easy. For example,
if besides the standard email you also want to send a SMS text message to
Expand Down Expand Up @@ -58,12 +59,12 @@ Spree::Event.subscribe /.*\.spree$/ do |event|
end
```

Please note that, unless you add explicitly the `.spree` suffix namespace,
you will register to all ActiveSupportNotifications, including Rails internal
ones.
Please note that, when using a regexp, unless you add explicitly the `.spree`
suffix namespace you will register to all ActiveSupportNotifications, including
Rails internal ones.

Another way to subscribe to events is creating a "subscriber" module that
includes the `Spree::Event::Subscriber` module. For example:
You can subscribe to events also by creating a "subscriber" module that includes
the `Spree::Event::Subscriber` module. For example:

```ruby
# app/subscribers/spree/sms_subscriber.rb
Expand Down

0 comments on commit 2aac8ee

Please sign in to comment.