sant0sk1 / tmail_body_extractors

Extends TMail::Mail with instance methods for extracting just html or plaintext from email body.

This URL has Read+Write access

tmail_body_extractors / README.md
100644 20 lines (14 sloc) 0.67 kb

TMail Body Extractors

Notes

Originally authored by Fernando Guillen under the name tmail-html-body-extractor and available on Google Code. I swiped it up and added test-driven method to deliver plaintext only from TMail::Mail object. Released under Apache License 2.0

Usage

require "tmail_mail_extension"

mail = TMail::Mail.parse(source)

mail.body_html   # returns just html if available or nil
mail.body_plain  # returns just plaintext if available or nil