instance method
body
Ruby on Rails 2.3.18
Since v2.2.3 Last seen in v2.3.18Available in: v2.2.3 v2.3.18
Signature
body(to_charset = 'utf-8', &block)
No documentation comment.
Parameters
-
to_charsetopt = 'utf-8' -
blockblock
Source
# File actionmailer/lib/action_mailer/vendor/tmail-1.2.7/tmail/quoting.rb, line 36
def body(to_charset = 'utf-8', &block)
attachment_presenter = block || Proc.new { |file_name| "Attachment: #{file_name}\n" }
if multipart?
parts.collect { |part|
header = part["content-type"]
if part.multipart?
part.body(to_charset, &attachment_presenter)
elsif header.nil?
""
elsif !attachment?(part)
part.unquoted_body(to_charset)
else
attachment_presenter.call(header["name"] || "(unnamed)")
end
}.join
else
unquoted_body(to_charset)
end
end
Defined in actionmailer/lib/action_mailer/vendor/tmail-1.2.7/tmail/quoting.rb line 36
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in TMail::Mail