Skip to content

Instantly share code, notes, and snippets.

@mjtko
Created September 4, 2011 13:40
Show Gist options
  • Save mjtko/1192864 to your computer and use it in GitHub Desktop.
Save mjtko/1192864 to your computer and use it in GitHub Desktop.
Monkey patch Mail to word wrap every body before delivery
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