aboutsummaryrefslogtreecommitdiffstats
path: root/app/models/outgoing_message.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/outgoing_message.rb')
-rw-r--r--app/models/outgoing_message.rb10
1 files changed, 8 insertions, 2 deletions
diff --git a/app/models/outgoing_message.rb b/app/models/outgoing_message.rb
index 5bd5898f9..07bb2a8e4 100644
--- a/app/models/outgoing_message.rb
+++ b/app/models/outgoing_message.rb
@@ -208,11 +208,11 @@ class OutgoingMessage < ActiveRecord::Base
end
# Returns text for indexing / text display
- def get_text_for_indexing
+ def get_text_for_indexing(strip_salutation=true)
text = self.body.strip
# Remove salutation
- text.sub!(/Dear .+,/, "")
+ text.sub!(/Dear .+,/, "") if strip_salutation
# Remove email addresses from display/index etc.
self.remove_privacy_sensitive_things!(text)
@@ -232,6 +232,12 @@ class OutgoingMessage < ActiveRecord::Base
return text.html_safe
end
+ # Return body for display as text
+ def get_body_for_text_display
+ get_text_for_indexing(strip_salutation=false)
+ end
+
+
def fully_destroy
ActiveRecord::Base.transaction do
info_request_event = InfoRequestEvent.find_by_outgoing_message_id(self.id)