Class: Gitlab::Email::Hook::EmailTemplateInterceptor

Inherits:
Object
  • Object
show all
Defined in:
lib/gitlab/email/hook/email_template_interceptor.rb

Class Method Summary collapse

Class Method Details

.delivering_email(message) ⇒ Object

Remove HTML part if HTML emails are disabled.


10
11
12
13
14
15
16
# File 'lib/gitlab/email/hook/email_template_interceptor.rb', line 10

def self.delivering_email(message)
  unless Gitlab::CurrentSettings.html_emails_enabled
    message.parts.delete_if do |part|
      part.content_type.start_with?('text/html')
    end
  end
end