summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Speicher <robert@gitlab.com>2017-01-09 19:16:26 +0000
committerDouglas Barbosa Alexandre <dbalexandre@gmail.com>2017-01-09 14:31:52 -0500
commit1be3ac8810112e0114d9ada9f8dc5d186a038fdc (patch)
tree40c4b8b9a70a0e1a733cc56bb30ab3da9919e762
parent59b46c66964b2fa58d22ff5e64069f218959bbab (diff)
downloadgitlab-ce-1be3ac8810112e0114d9ada9f8dc5d186a038fdc.tar.gz
Merge branch 'fix-plain-text-emails' into 'master'
Use #parts instead of #part to read all the parts of the Message. Closes #26463 See merge request !8507
-rw-r--r--lib/email_template_interceptor.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/email_template_interceptor.rb b/lib/email_template_interceptor.rb
index fb04a7824b8..63f9f8d7a5a 100644
--- a/lib/email_template_interceptor.rb
+++ b/lib/email_template_interceptor.rb
@@ -5,8 +5,8 @@ class EmailTemplateInterceptor
def self.delivering_email(message)
# Remove HTML part if HTML emails are disabled.
unless current_application_settings.html_emails_enabled
- message.part.delete_if do |part|
- part.content_type.try(:start_with?, 'text/html')
+ message.parts.delete_if do |part|
+ part.content_type.start_with?('text/html')
end
end
end