BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
d78e80fa
Commit
d78e80fa
authored
Oct 27, 2014
by
Marin Jankovski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add email interceptor to prevent mail sending if email sending is disabled.
parent
d504ca8a
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
0 deletions
+10
-0
disable_email_interceptor.rb
config/initializers/disable_email_interceptor.rb
+2
-0
disable_email_interceptor.rb
lib/disable_email_interceptor.rb
+8
-0
No files found.
config/initializers/disable_email_interceptor.rb
0 → 100644
View file @
d78e80fa
# Interceptor in lib/disable_email_interceptor.rb
ActionMailer
::
Base
.
register_interceptor
(
DisableEmailInterceptor
)
unless
Gitlab
.
config
.
gitlab
.
email_enabled
lib/disable_email_interceptor.rb
0 → 100644
View file @
d78e80fa
# Read about interceptors in http://guides.rubyonrails.org/action_mailer_basics.html#intercepting-emails
class
DisableEmailInterceptor
def
self
.
delivering_email
(
message
)
message
.
perform_deliveries
=
false
Rails
.
logger
.
info
"Emails disabled! Interceptor prevented sending mail
#{
message
.
subject
}
"
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment