Skip to content

Commit 1e3edfe

Browse files
authored
Merge pull request #153 from benjaminwil/configurable-event-subscribers
2 parents 922b8fc + c7919ce commit 1e3edfe

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

docs/customization/subscribing-to-events.mdx

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,29 @@ subscriptions.
8484

8585
:::
8686

87+
### Built-in event subscribers
88+
89+
Solidus comes with built-in event subscribers for some event-driven functionality in the system. For
90+
example, all transactional emails are initiated through event subscribers.
91+
92+
When the `solidus_core` engine is loaded, all of the built-in event subscribers are loaded from
93+
`Spree::Config.environment.subscribers`. If you wanted to exclude some of the built-in subscribers
94+
you could do so from an initializer in your application:
95+
96+
```ruby
97+
# config/initializers/spree.rb
98+
99+
Spree.config do |config|
100+
config.environment.subscribers = [
101+
"Spree::OrderCancelMailerSubscriber",
102+
"Spree::OrderConfirmationMailerSubscriber",
103+
"Spree::OrderInventoryCancellationMailerSubscriber"
104+
]
105+
end
106+
```
107+
108+
See `Spree::AppConfiguration` for an up-to-date list of Solidus' built-in subscribers.
109+
87110
### Custom events
88111

89112
You're free to register your custom events into `Spree::Bus`. However, it's a good practice if you

0 commit comments

Comments
 (0)