summaryrefslogtreecommitdiff
path: root/lib/email_template_interceptor.rb
blob: 3978a6d9fe44bcab42275051c3efbdc581e596d2 (plain)
1
2
3
4
5
6
7
8
9
10
11
# 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.
    unless Gitlab::CurrentSettings.html_emails_enabled
      message.parts.delete_if do |part|
        part.content_type.start_with?('text/html')
      end
    end
  end
end