2016-11-28 17:00:03 -05:00
|
|
|
# Read about interceptors in http://guides.rubyonrails.org/action_mailer_basics.html#intercepting-emails
|
|
|
|
class EmailTemplateInterceptor
|
|
|
|
def self.delivering_email(message)
|
|
|
|
# Remove HTML part if HTML emails are disabled.
|
2018-02-02 13:39:55 -05:00
|
|
|
unless Gitlab::CurrentSettings.html_emails_enabled
|
2017-01-09 13:01:07 -05:00
|
|
|
message.parts.delete_if do |part|
|
|
|
|
part.content_type.start_with?('text/html')
|
2016-11-28 17:00:03 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|