diff options
author | francis <francis> | 2008-02-25 11:17:28 +0000 |
---|---|---|
committer | francis <francis> | 2008-02-25 11:17:28 +0000 |
commit | f0e82f7c01209e9e7c2dca17bee593166b849d3f (patch) | |
tree | a2cdbe73e916d1b3a0d6bccee7889d743ee40ad2 /app/models | |
parent | 33aaf2512ec2ea1b74cadb25c8352ec87cb98dae (diff) |
Preview requests.
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/outgoing_message.rb | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/app/models/outgoing_message.rb b/app/models/outgoing_message.rb index 519c0be94..9c76bc03f 100644 --- a/app/models/outgoing_message.rb +++ b/app/models/outgoing_message.rb @@ -21,7 +21,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.29 2008-02-21 20:45:51 francis Exp $ +# $Id: outgoing_message.rb,v 1.30 2008-02-25 11:17:29 francis Exp $ class OutgoingMessage < ActiveRecord::Base belongs_to :info_request @@ -124,7 +124,18 @@ class OutgoingMessage < ActiveRecord::Base # Return body for display as HTML def get_body_for_html_display - text = body + text = self.body + text = MySociety::Format.make_clickable(text, :contract => 1) + text = text.gsub(/\n/, '<br>') + + return text + end + + # Return body for display as HTML + # XXX this is repeating code in a combination of + # views/layouts/request_mailer.rhtml and views/request_mailer/initial_request.rhtml + def get_body_for_html_preview + text = MySociety::Format.wrap_email_body(self.body.strip) text = MySociety::Format.make_clickable(text, :contract => 1) text = text.gsub(/\n/, '<br>') |