Use #parts instead of #part to read all the parts of the Message.

Looks like I was accidentally using #part which was adding an extra
empty Mime section
This commit is contained in:
Ruben Davila 2017-01-09 13:01:07 -05:00
parent 6c62482144
commit c6ebe440da

View file

@ -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