Remove useless text from received mails via the email_reply_trimmer gem
This commit is contained in:
parent
ecdf3bc147
commit
185f682f6c
3 changed files with 7 additions and 0 deletions
|
@ -24,6 +24,7 @@ PATH
|
||||||
foodsoft_messages (0.0.1)
|
foodsoft_messages (0.0.1)
|
||||||
base32
|
base32
|
||||||
deface (~> 1.0)
|
deface (~> 1.0)
|
||||||
|
email_reply_trimmer
|
||||||
mail
|
mail
|
||||||
rails
|
rails
|
||||||
|
|
||||||
|
@ -151,6 +152,7 @@ GEM
|
||||||
docile (1.1.5)
|
docile (1.1.5)
|
||||||
domain_name (0.5.20170223)
|
domain_name (0.5.20170223)
|
||||||
unf (>= 0.0.5, < 1.0.0)
|
unf (>= 0.0.5, < 1.0.0)
|
||||||
|
email_reply_trimmer (0.1.8)
|
||||||
erubis (2.7.0)
|
erubis (2.7.0)
|
||||||
eventmachine (1.0.9.1)
|
eventmachine (1.0.9.1)
|
||||||
exception_notification (4.2.1)
|
exception_notification (4.2.1)
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
require "email_reply_trimmer"
|
||||||
|
|
||||||
class MessagesMailReceiver
|
class MessagesMailReceiver
|
||||||
|
|
||||||
def self.regexp
|
def self.regexp
|
||||||
|
@ -37,6 +39,8 @@ class MessagesMailReceiver
|
||||||
body = Nokogiri::HTML(body).text
|
body = Nokogiri::HTML(body).text
|
||||||
end
|
end
|
||||||
|
|
||||||
|
body = EmailReplyTrimmer.trim(body)
|
||||||
|
|
||||||
message = user.send_messages.new body: body,
|
message = user.send_messages.new body: body,
|
||||||
group: original_message.group,
|
group: original_message.group,
|
||||||
private: original_message.private,
|
private: original_message.private,
|
||||||
|
|
|
@ -19,6 +19,7 @@ Gem::Specification.new do |s|
|
||||||
s.add_dependency "rails"
|
s.add_dependency "rails"
|
||||||
s.add_dependency "base32"
|
s.add_dependency "base32"
|
||||||
s.add_dependency "deface", "~> 1.0"
|
s.add_dependency "deface", "~> 1.0"
|
||||||
|
s.add_dependency "email_reply_trimmer"
|
||||||
s.add_dependency "mail"
|
s.add_dependency "mail"
|
||||||
|
|
||||||
s.add_development_dependency "sqlite3"
|
s.add_development_dependency "sqlite3"
|
||||||
|
|
Loading…
Reference in a new issue