Skip to content

Commit 3e11921

Browse files
Merge pull request #14 from bigbinary/cleaning
updated README
2 parents 3c6e968 + ed98727 commit 3e11921

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

README.md

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,15 +80,24 @@ MailInterceptor::Interceptor.new({ forward_emails_to: ['intercepted_emails@bigbi
8080

8181
### Custom environment
8282

83-
If your staging environment is using the same Rails environment as
84-
production, you can pass in an object with the name of the environment
85-
and whether to intercept mail as an option. The default is to use
86-
`Rails.env` and intercept mail in all environments except production.
83+
By default all emails sent in non production environment are
84+
intercepted. However you can control this behavior by passing `env` as
85+
the key. It accepts any ruby objects which responds to `intercept?`
86+
method. If the result of that method is `true` then emails are
87+
intercepted otherwise emails are not intercepted.
88+
89+
Below is an example of how to pass a custom ruby object as value for
90+
`env` key.
91+
92+
Besides method `intercept?` method `name` is needed if you have provided
93+
`subject_prefix`. This name will be appended to the `subject_prefix` to
94+
produce something like `[WHEEL STAGING] Forgot password`. In this case
95+
`STAGING` came form `name`.
8796

8897
```ruby
8998
class MyEnv
9099
def name
91-
ENV["INSTANCE_NAME"]
100+
ENV["ENVIRONMENT_NAME"]
92101
end
93102

94103
def intercept?

0 commit comments

Comments
 (0)