2017-08-17 22:00:37 +05:30
|
|
|
# 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-03-17 18:26:18 +05:30
|
|
|
unless Gitlab::CurrentSettings.html_emails_enabled
|
2017-08-17 22:00:37 +05:30
|
|
|
message.parts.delete_if do |part|
|
|
|
|
part.content_type.start_with?('text/html')
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|