Search email message by title
Simple snippet.
thread = Email.where(["email = ? AND subject LIKE ?", email, "%#{subject.gsub(/(Re:\s)+?|(Fwd:\s)+?|Re\[\d+\]:\s/i, "")}%"]).last(10)
P.S. Yes. We store messages in database :)
Written by Alex Lushpai
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Ruby
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#