Skip to content

Commit ed98727

Browse files
author
Neeraj Singh
committed
updated README
1 parent 5b60812 commit ed98727

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
@@ -89,15 +89,24 @@ MailInterceptor::Interceptor.new({ forward_emails_to: ['intercepted_emails@bigbi
8989

9090
### Custom environment
9191

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

97106
```ruby
98107
class MyEnv
99108
def name
100-
ENV["INSTANCE_NAME"]
109+
ENV["ENVIRONMENT_NAME"]
101110
end
102111

103112
def intercept?

0 commit comments

Comments
 (0)