BigW Consortium Gitlab

email_template_interceptor.rb 439 Bytes
Newer Older
1 2 3 4 5 6 7
# Read about interceptors in http://guides.rubyonrails.org/action_mailer_basics.html#intercepting-emails
class EmailTemplateInterceptor
  include Gitlab::CurrentSettings

  def self.delivering_email(message)
    # Remove HTML part if HTML emails are disabled.
    unless current_application_settings.html_emails_enabled
8 9
      message.parts.delete_if do |part|
        part.content_type.start_with?('text/html')
10 11 12 13
      end
    end
  end
end