method
wrap_inline_attachments
v6.1.7.7 -
Show latest stable
- Class:
ActionMailer::Base
wrap_inline_attachments(message)private
No documentation available.
# File actionmailer/lib/action_mailer/base.rb, line 973
def wrap_inline_attachments(message)
# If we have both types of attachment, wrap all the inline attachments
# in multipart/related, but not the actual attachments
if message.attachments.detect(&:inline?) && message.attachments.detect { |a| !a.inline? }
related = Mail::Part.new
related.content_type = "multipart/related"
mixed = [ related ]
message.parts.each do |p|
if p.attachment? && !p.inline?
mixed << p
else
related.add_part(p)
end
end
message.parts.clear
mixed.each { |c| message.add_part(c) }
end
end