instance method
wrap_inline_attachments
Ruby on Rails 7.1.6
Since v6.1.7.10 PrivateSignature
wrap_inline_attachments(message)
No documentation comment.
Parameters
-
messagereq
Source
# File actionmailer/lib/action_mailer/base.rb, line 1019
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
Defined in actionmailer/lib/action_mailer/base.rb line 1019
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActionMailer::Base