Remove useless text from received mails via the email_reply_trimmer gem

This commit is contained in:
Patrick Gansterer 2017-09-30 01:20:12 +02:00
parent ecdf3bc147
commit 185f682f6c
3 changed files with 7 additions and 0 deletions

View file

@ -24,6 +24,7 @@ PATH
foodsoft_messages (0.0.1)
base32
deface (~> 1.0)
email_reply_trimmer
mail
rails
@ -151,6 +152,7 @@ GEM
docile (1.1.5)
domain_name (0.5.20170223)
unf (>= 0.0.5, < 1.0.0)
email_reply_trimmer (0.1.8)
erubis (2.7.0)
eventmachine (1.0.9.1)
exception_notification (4.2.1)

View file

@ -1,3 +1,5 @@
require "email_reply_trimmer"
class MessagesMailReceiver
def self.regexp
@ -37,6 +39,8 @@ class MessagesMailReceiver
body = Nokogiri::HTML(body).text
end
body = EmailReplyTrimmer.trim(body)
message = user.send_messages.new body: body,
group: original_message.group,
private: original_message.private,

View file

@ -19,6 +19,7 @@ Gem::Specification.new do |s|
s.add_dependency "rails"
s.add_dependency "base32"
s.add_dependency "deface", "~> 1.0"
s.add_dependency "email_reply_trimmer"
s.add_dependency "mail"
s.add_development_dependency "sqlite3"