Created
September 4, 2011 13:40
-
-
Save mjtko/1192864 to your computer and use it in GitHub Desktop.
Monkey patch Mail to word wrap every body before delivery
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Mail | |
class Message | |
include ActionView::Helpers::TextHelper | |
def deliver_with_word_wrap | |
self.body = word_wrap(self.body, :line_width => 70) | |
deliver_without_word_wrap | |
end | |
alias_method_chain :deliver, :word_wrap | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment