Welcome to mirror list, hosted at ThFree Co, Russian Federation.

email_template_interceptor.rb « lib - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
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