require "tamtam" ActionMailer::Part # Ensuring the class has already been defined module ActionMailer class Part def body if content_type == "text/html" TamTam.inline(:document => @body) else @body end end end end