summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2018-07-16 12:02:53 +0200
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2018-07-16 12:02:53 +0200
commit51b81d7feb08183bedcb17f973c257ab11da09a5 (patch)
tree113494f44915e77a74800a2f4ab2927b8c54d692 /config
parente682d941807f176ceeb8a639dc498b25560e853e (diff)
downloadgitlab-ce-51b81d7feb08183bedcb17f973c257ab11da09a5.tar.gz
Register all action mailer interceptors in a single place
Diffstat (limited to 'config')
-rw-r--r--config/initializers/action_mailer_hooks.rb7
-rw-r--r--config/initializers/additional_headers_interceptor.rb2
-rw-r--r--config/initializers/disable_email_interceptor.rb4
-rw-r--r--config/initializers/email_template_interceptor.rb1
4 files changed, 7 insertions, 7 deletions
diff --git a/config/initializers/action_mailer_hooks.rb b/config/initializers/action_mailer_hooks.rb
new file mode 100644
index 00000000000..f792e2dc68e
--- /dev/null
+++ b/config/initializers/action_mailer_hooks.rb
@@ -0,0 +1,7 @@
+unless Gitlab.config.gitlab.email_enabled
+ ActionMailer::Base.register_interceptor(::Gitlab::Email::Hook::DisableEmailInterceptor)
+ ActionMailer::Base.logger = nil
+end
+
+ActionMailer::Base.register_interceptor(::Gitlab::Email::Hook::AdditionalHeadersInterceptor)
+ActionMailer::Base.register_interceptor(::Gitlab::Email::Hook::EmailTemplateInterceptor)
diff --git a/config/initializers/additional_headers_interceptor.rb b/config/initializers/additional_headers_interceptor.rb
deleted file mode 100644
index fe4db2d3819..00000000000
--- a/config/initializers/additional_headers_interceptor.rb
+++ /dev/null
@@ -1,2 +0,0 @@
-ActionMailer::Base
- .register_interceptor(::Gitlab::Email::Hook::AdditionalHeadersInterceptor)
diff --git a/config/initializers/disable_email_interceptor.rb b/config/initializers/disable_email_interceptor.rb
deleted file mode 100644
index 72d6c4a53c1..00000000000
--- a/config/initializers/disable_email_interceptor.rb
+++ /dev/null
@@ -1,4 +0,0 @@
-unless Gitlab.config.gitlab.email_enabled
- ActionMailer::Base.register_interceptor(::Gitlab::Email::Hook::DisableEmailInterceptor)
- ActionMailer::Base.logger = nil
-end
diff --git a/config/initializers/email_template_interceptor.rb b/config/initializers/email_template_interceptor.rb
deleted file mode 100644
index dfa8a69b1f3..00000000000
--- a/config/initializers/email_template_interceptor.rb
+++ /dev/null
@@ -1 +0,0 @@
-ActionMailer::Base.register_interceptor(::Gitlab::Email::Hook::EmailTemplateInterceptor)