ActionMailer
No documentation available for this module.
Files
- actionmailer/lib/action_mailer/adv_attr_accessor.rb
- actionmailer/lib/action_mailer/base.rb
- actionmailer/lib/action_mailer/helpers.rb
- actionmailer/lib/action_mailer/part.rb
- actionmailer/lib/action_mailer/part_container.rb
- actionmailer/lib/action_mailer/quoting.rb
- actionmailer/lib/action_mailer/test_case.rb
- actionmailer/lib/action_mailer/test_helper.rb
- actionmailer/lib/action_mailer/utils.rb
- actionmailer/lib/action_mailer/version.rb
Nested classes and modules
- ActionMailer::AdvAttrAccessor
- ActionMailer::Base
- ActionMailer::Helpers
- ActionMailer::NonInferrableMailerError
- ActionMailer::Part
- ActionMailer::PartContainer
- ActionMailer::Quoting
- ActionMailer::TestCase
- ActionMailer::TestHelper
- ActionMailer::Utils
- ActionMailer::VERSION
3Notes
For more information
See Base class.
For more information
See ActiveMailer::Base.
Extract plain text body from TMail parsed email
Here's a monkey patch for TMail::Mail I wrote to recurse through a message and extract all plain text body components of that message, returning an Array. For most use cases, the resulting Array will contain one String element.
Currently I put this code in a file called lib/tmail_extensions.rb and require 'tmail_extensions' in environment.rb
module TMail class Mail def plain_text_body gather_plain_text_parts(self).flatten end
private
def gather_plain_text_parts(part)
returning [] do |message|
message << part.body.strip if part.content_type == 'text/plain'
part.parts.each { |p| message << gather_plain_text_parts(p) }
end
end
end
end