aboutsummaryrefslogtreecommitdiffstats
path: root/app/models
diff options
context:
space:
mode:
Diffstat (limited to 'app/models')
-rw-r--r--app/models/outgoing_message.rb14
1 files changed, 13 insertions, 1 deletions
diff --git a/app/models/outgoing_message.rb b/app/models/outgoing_message.rb
index b8c5678b0..cf5237f82 100644
--- a/app/models/outgoing_message.rb
+++ b/app/models/outgoing_message.rb
@@ -22,7 +22,7 @@
# Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved.
# Email: francis@mysociety.org; WWW: http://www.mysociety.org/
#
-# $Id: outgoing_message.rb,v 1.91 2009-09-17 21:10:05 francis Exp $
+# $Id: outgoing_message.rb,v 1.92 2009-10-03 10:04:06 francis Exp $
class OutgoingMessage < ActiveRecord::Base
strip_attributes!
@@ -221,6 +221,18 @@ class OutgoingMessage < ActiveRecord::Base
text = text.gsub(/\n/, '<br>')
return text
end
+ # Testing whether we can just wrap lines rather than between blank line separated paragraphs
+ def new_get_body_for_html_display
+ text = self.body.strip
+ self.remove_privacy_sensitive_things!(text)
+ #text = MySociety::Format.wrap_email_body(text, 67, " ", "\n") # reparagraph and wrap it so is good preview of emails
+ text = CGI.escapeHTML(text)
+ text = MySociety::Format.make_clickable(text, :contract => 1)
+ text.gsub!(/\[(email address|mobile number)\]/, '[<a href="/help/about#mobiles">\1</a>]')
+ text = text.gsub(/\n/, '<br>')
+ return text
+ end
+
def fully_destroy
ActiveRecord::Base.transaction do